Автор работы: Пользователь скрыл имя, 05 Декабря 2012 в 16:26, курсовая работа
Данный курсовой проект выполняется с целью закрепления знаний, полученных при изучении курса «Процессоры для цифровой обработки сигналов», и развития навыков самостоятельного проектирования цифровых устройств фильтрации с использованием современной элементной базы.
Цифровая фильтрация является одним из основных направлений цифровой обработки сигналов (далее ЦОС). В настоящее время она имеет широкое применение. Поэтому тема данного проекта особо актуальна, учитывая и то, что для разработки используется современная элементная база зарубежных фирм-производителей, лидеров мирового рынка устройств для цифровой и аналоговой обработки сигналов.
Введение 3
1. Постановка задачи проектирования 4
2. Анализ задачи и выбор рационального способа решения 5
3. Разработка алгоритмов фильтрации 7
3.1. Синтез ядра фильтра 7
3.2. Свертка с использованием БПФ 12
3.3. Алгоритм БПФ 15
3.4. Моделирование алгоритмов и проверка работоспособности 18
4. Разработка принципиальной схемы 21
4.1. Выбор элементной базы 21
4.2. Построение схемы 24
5. Разработка программного обеспечения 28
6. Оценка временных параметров 34
Заключение 38
Список использованной литературы 39
ПРИЛОЖЕНИЕ 40
if(in_index==M)
{
in_index=0;
frame1_fl=true;//установка флага, свидетельствующего о том,
//что первый буфер заполнен
frame2in_fl=true;
frame1in_fl=false;
return;
}
else in_index++;
}
else if(frame2in_fl)//запись во второй буфер
{
frame2_re[in_index]=*(McBSP1_
if(in_index==M)
{
in_index=0;
frame2_fl=true;//установка флага, свидетельствующего о том,
//что второй буфер заполнен
frame1in_fl=true;
frame2in_fl=false;//флаги показывают, что нужно писать в первый буфер
return;
}
else in_index++;
}
}
void Filter(short Fd,short Fc,short* h)
{
int i,j;
double tmp, tempH, tempL;
double Hh[M],Hl[M];
double suml=0, sumh=0;
for (i=- halfM;i< halfM;i++)
{
j=i+ halfM; // i=- halfM.. halfM j=0..M
if (i==0)
{
Hh[halfM]=1;
Hl[halfM]=1;
}
else
{
tmp= PiFFC2*i;
tempH=tmp*2*fh;
tempH=sin(tempH);
tempL=tmp*2*fl;
tempL=sin(tempL);
Hh[j]=tempH/tmp;
Hl[j]=tempL/tmp;
}
//окно
Hl[j]=Hl[j]* Blackman [j];
Hh[j]=Hh[j]* Blackman [j];
//сумма для нормализации
suml+=Hl[j];
sumh+=Hh[j];
}
//нормализация
for (i=0;i<M;i++)
{
Hl[i]/=suml;
Hh[i]/=sumh;
H[i]=Hh[i]-Hl[i];
}
return;
}
void BPF(short* x,short* y,short N,short I)
{
short t1,t2,t3,t4;
short i,j,k,m,p,l,L,M,M1,K;
L=N;
M=N/2;
M1=N-1;
if(I==-1)//если обратное преобразование, то инверсия мнимой части
{
for(i=0;i<N;i++)*(y+i)=-*(y+i)
}
m=1;
while(L>=2)
{
l=L/2;
k=0;
for(j=0;j<l;j++)
{
for(i=j;i<N;i+=L)
{
p=i+l;
t1=*(x+i)+*(x+p);
t2=*(y+i)+*(y+p);
t3=*(x+i)-*(x+p);
t4=*(y+i)-*(y+p);
*(x+p)=t3*Wre[k]-t4*Wim[k];
*(y+p)=t4*Wre[k]+t3*Wim[k];
*(x+i)=t1;
*(y+i)=t2;
}
k+=m;
}
L/=2;
m*=2;
}
j=0;
for(i=0;i<M1;i++) //прореживание по частоте
{
if(i>j)
{
t1=*(x+j);
t2=*(y+j);
*(x+j)=*(x+i);
*(y+j)=*(y+i);
*(x+i)=t1;
*(y+i)=t2;
}
K=M;
while(j>=K)
{
j-=K;
K/=2;
}
j+=K;
}
if(I==-1)//нормализация при обратном преобразовании
{
for(i=0;i<N;i++)
{
*(x+i)/=N;
*(y+i)/=N;
}
}
}
Таблица векторов прерываний
//****************************
//* S/W Interrupts
//****************************
SINT17 return_enable
nop
nop
nop
SINT18 return_enable
nop
nop
nop
SINT19 return_enable
nop
nop
nop
SINT20 return_enable
nop
nop
nop
SINT21 return_enable
nop
nop
nop
SINT22 return_enable
nop
nop
nop
SINT23 return_enable
nop
nop
nop
SINT24 return_enable
nop
nop
nop
SINT25 return_enable
nop
nop
nop
SINT26 return_enable
nop
nop
nop
SINT27 return_enable
nop
nop
nop
SINT28 return_enable
nop
nop
nop
SINT29 return_enable
nop
nop
nop
SINT30 return_enable
nop
nop
nop
//****************************
//* Rest of the Interrupts
//****************************
INT0: return_enable
nop
nop
nop
INT1: return_enable
nop
nop
nop
INT2: return_enable
nop
nop
nop
TINT0: dgoto timer_interrupt
nop
nop
BRINT0: return_enable
nop
nop
nop
BXINT0: return_enable
nop
nop
nop
TRINT: return_enable
nop
nop
nop
TXINT: return_enable
nop
nop
nop
INT3: return_enable
nop
nop
nop
HPINT: return_enable
nop
nop
nop
BRINT1: dgoto McBSP1_Rinterrupt
nop
nop
BXINT1: return_enable
nop
nop
nop
DMAC4: return_enable
nop
nop
nop
DMAC5: return_enable
nop
nop
nop
short Blackman[]= {0.00000,0.00001,
0.00137,0.00166,0.00197,0.
0.00555,0.00614,0.00675,0.
0.01282,0.01373,0.01467,0.
0.02356,0.02484,0.02617,0.
0.03828,0.03999,0.04175,0.
0.05755,0.05975,0.06201,0.
0.08195,0.08469,0.08749,0.
0.11198,0.11531,0.11870,0.
0.14805,0.15200,0.15601,0.
0.19037,0.19495,0.19959,0.
0.23895,0.24415,0.24940,0.
0.29352,0.29929,0.30512,0.
0.35354,0.35981,0.36613,0.
0.41816,0.42483,0.43154,0.
0.48624,0.49319,0.50016,0.
0.55641,0.56348,0.57055,0.
0.62705,0.63407,0.64108,0.
0.69640,0.70319,0.70995,0.
0.76261,0.76898,0.77530,0.
0.82380,0.82957,0.83527,0.
0.87817,0.88316,0.88807,0.
0.92406,0.92813,0.93209,0.
0.96005,0.96305,0.96595,0.
0.98497,0.98682,0.98855,0.
0.99804,0.99867,0.99918,0.
0.99882,0.99822,0.99749,0.
0.98728,0.98546,0.98353,0.
0.96381,0.96084,0.95775,0.
0.92916,0.92512,0.92099,0.
0.88444,0.87947,0.87441,0.
0.83105,0.82530,0.81948,0.
0.77063,0.76426,0.75785,0.
0.70495,0.69817,0.69135,0.
0.63589,0.62887,0.62184,0.
0.56531,0.55824,0.55117,0.
0.49500,0.48804,0.48111,0.
0.42657,0.41988,0.41324,0.
0.36145,0.35516,0.34893,0.
0.30080,0.29501,0.28929,0.
0.24550,0.24029,0.23514,0.
0.19615,0.19155,0.18702,0.
0.15303,0.14907,0.14516,0.
0.11618,0.11284,0.10955,0.
0.08541,0.08265,0.07995,0.
0.06033,0.05812,0.05596,0.
0.04045,0.03872,0.03704,0.
0.02518,0.02389,0.02263,0.
0.01397,0.01305,0.01217,0.
0.00629,0.00570,0.00514,0.
0.00174,0.00144,0.00117,0.
0.00002};
short Wre[]= {1.00000,0.99998,0.
0.99812,0.99773,0.99729,0.
0.99249,0.99172,0.99091,0.
0.98312,0.98198,0.98080,0.
0.97006,0.96855,0.96701,0.
0.95335,0.95148,0.94958,0.
0.93306,0.93084,0.92858,0.
0.90926,0.90669,0.90409,0.
0.88204,0.87913,0.87619,0.
0.85150,0.84827,0.84501,0.
0.81776,0.81422,0.81064,0.
0.78095,0.77711,0.77323,0.
0.74120,0.73707,0.73291,0.
0.69867,0.69426,0.68984,0.
0.65350,0.64885,0.64417,0.
0.60588,0.60099,0.59608,0.
0.55598,0.55088,0.54575,0.
0.50400,0.49869,0.49336,0.
0.45011,0.44463,0.43912,0.
0.39454,0.38889,0.38324,0.
0.33748,0.33170,0.32590,0.
0.27915,0.27325,0.26735,0.
0.21977,0.21378,0.20779,0.
0.15956,0.15351,0.14744,0.
0.09876,0.09266,0.08655,0.
0.03758,0.03146,0.02532,0.
-0.02373,-0.02986,-0.03599,-0.
-0.07885,-0.08496,-0.09107,-0.
-0.13372,-0.13980,-0.14587,-0.
-0.18819,-0.19421,-0.20022,-0.
-0.24209,-0.24803,-0.25397,-0.
-0.29524,-0.30110,-0.30694,-0.
-0.34750,-0.35325,-0.35898,-0.
-0.39870,-0.40432,-0.40992,-0.
-0.44869,-0.45416,-0.45962,-0.
-0.49731,-0.50262,-0.50791,-0.
-0.54441,-0.54955,-0.55466,-0.
-0.58986,-0.59480,-0.59972,-0.
-0.63351,-0.63824,-0.64295,-0.
-0.67523,-0.67974,-0.68422,-0.
-0.71489,-0.71917,-0.72341,-0.
-0.75238,-0.75640,-0.76040,-0.
-0.78757,-0.79134,-0.79507,-0.
-0.82037,-0.82386,-0.82732,-0.
-0.85067,-0.85387,-0.85705,-0.
-0.87837,-0.88129,-0.88417,-0.
-0.90340,-0.90602,-0.90859,-0.
-0.92568,-0.92799,-0.93025,-0.
-0.94514,-0.94713,-0.94908,-0.
-0.96172,-0.96339,-0.96501,-0.
-0.97538,-0.97671,-0.97801,-0.
-0.98606,-0.98706,-0.98802,-0.
-0.99374,-0.99440,-0.99503,-0.
-0.99839,-0.99872,-0.99901,-0.
short Wim[]= {0.00000,-0.00613,-0.
-0.06129,-0.06741,-0.07353,-0.
-0.12235,-0.12843,-0.13451,-0.
-0.18295,-0.18897,-0.19499,-0.
-0.24286,-0.24880,-0.25474,-0.
-0.30186,-0.30770,-0.31353,-0.
-0.35972,-0.36544,-0.37114,-0.
-0.41623,-0.42180,-0.42735,-0.
-0.47118,-0.47658,-0.48196,-0.
-0.52435,-0.52956,-0.53476,-0.
-0.57555,-0.58056,-0.58554,-0.
-0.62459,-0.62937,-0.63412,-0.
-0.67128,-0.67582,-0.68032,-0.
-0.71545,-0.71972,-0.72396,-0.
-0.75692,-0.76092,-0.76488,-0.
-0.79555,-0.79926,-0.80293,-0.
-0.83119,-0.83459,-0.83795,-0.
-0.86371,-0.86678,-0.86982,-0.
-0.89297,-0.89572,-0.89843,-0.
-0.91888,-0.92128,-0.92365,-0.
-0.94133,-0.94339,-0.94540,-0.
-0.96025,-0.96194,-0.96360,-0.
-0.97555,-0.97688,-0.97817,-0.
-0.98719,-0.98815,-0.98907,-0.
-0.99511,-0.99570,-0.99625,-0.
-0.99929,-0.99951,-0.99968,-0.
-0.99972,-0.99955,-0.99935,-0.
-0.99638,-0.99584,-0.99527,-0.
-0.98930,-0.98839,-0.98744,-0.
-0.97850,-0.97722,-0.97590,-0.
-0.96402,-0.96238,-0.96069,-0.
-0.94592,-0.94391,-0.94187,-0.
-0.92426,-0.92190,-0.91951,-0.
-0.89912,-0.89642,-0.89369,-0.
-0.87061,-0.86757,-0.86451,-0.
-0.83882,-0.83546,-0.83208,-0.
-0.80387,-0.80021,-0.79652,-0.
-0.76591,-0.76195,-0.75796,-0.
-0.72506,-0.72082,-0.71656,-0.
-0.68149,-0.67699,-0.67246,-0.
-0.63535,-0.63061,-0.62584,-0.
-0.58683,-0.58185,-0.57686,-0.
-0.53610,-0.53091,-0.52571,-0.
-0.48336,-0.47798,-0.47258,-0.
-0.42879,-0.42324,-0.41768,-0.
-0.37262,-0.36692,-0.36121,-0.
-0.31504,-0.30921,-0.30338,-0.