Synteza i analiza filtru NOI (dolnoprzepustowego)
Charakterystyka częstotliwościowa.
gr=10;
wga=0.7874;
fp=1000+gr*100;
fgc=200+gr*10;
wgc=2*pi*fgc;
Tp=1/fp;
A=wga*(1/tan(wgc*Tp/2));
L=[1 2 1];
M=[(1+1.73*A+A^2) (-2*A^2+2) (A^2-1.73*A+1)];
[H,F]=freqz(L,M,512,fp);
plot(F,abs(H))
grid on
Charakterystyka fazowa.
gr=10;
wga=0.7874;
fp=1000+gr*100;
fgc=200+gr*10;
wgc=2*pi*fgc;
Tp=1/fp;
A=wga*(1/tan(wgc*(Tp/2)));
L=[1 2 1];
M=[(1+1.73*A+A^2) (-2*A^2+2) (A^2-1.73*A+1)];
[H,F]=freqz(L,M,512,fp);
P=angle(H)*180/pi;
plot(F,P)
grid on
Opóźnienie fazowe
gr=10;
wga=0.7874;
fp=1000+gr*100;
fgc=200+gr*10;
wgc=2*pi*fgc;
Tp=1/fp;
A=wga*(1/tan(wgc*(Tp/2)));
L=[1 2 1];
M=[(1+1.73*A+A^2) (-2*A^2+2) (A^2-1.73*A+1)];
phasedelay(L,M,512,fp)
grid on
Odpowiedz na skok jednostkowy.
gr=10;
wga=0.7874;
fp=1000+gr*100;
fgc=200+gr*10;
wgc=2*pi*fgc;
Tp=1/fp;
A=wga*(1/tan(wgc*(Tp/2)));
L=[1 2 1];
M=[(1+1.73*A+A^2) (-2*A^2+2) (A^2-1.73*A+1)];
[o,ts]=stepz(L,M);
plot(ts,o)
grid on
Analiza filtu SOI
fp=2000;
fodc=400;
f1=50;
N=fp/f1 ;
deltaf=fp/N
H=[exp(-i*(0:8)*pi*(N-1)/N),zeros(1,23),exp(i*(N-(32:39))*pi*(N-1)/N)]
stem(0:N-1,abs(H))
fp=2000;
fodc=400;
f1=50;
N=fp/f1 ;
deltaf=fp/N
H=[exp(-i*(0:8)*pi*(N-1)/N),zeros(1,23),exp(i*(N-(32:39))*pi*(N-1)/N)]
L=ifft(H)
impz(L,1)
fp=2000;
fodc=400;
f1=50;
N=fp/f1 ;
deltaf=fp/N
H=[exp(-i*(0:8)*pi*(N-1)/N),zeros(1,23),exp(i*(N-(32:39))*pi*(N-1)/N)]
stem(0:N-1,L)
Charakterystyka częstotliwościowa widmowa
fp=2000;
fodc=400;
f1=50;
N=fp/f1 ;
deltaf=fp/N
H=[exp(-i*(0:8)*pi*(N-1)/N),zeros(1,23),exp(i*(N-(32:39))*pi*(N-1)/N)]
[H,F]=freqz(L,1,512,fp);
plot(F,abs(H))
Charakterystyka częstotliwościowa z oknem wygładzającym
fp=2000;
fodc=400;
f1=50;
N=fp/f1 ;
deltaf=fp/N
H=[exp(-i*(0:8)*pi*(N-1)/N),zeros(1,23),exp(i*(N-(32:39))*pi*(N-1)/N)]
Lw=L.*hamming(N)';
[H,F]=freqz(Lw,1,512,fp);
plot(F,abs(H))
Charakterystyka fazowa
fp=2000;
fodc=400;
f1=50;
N=fp/f1 ;
deltaf=fp/N
H=[exp(-i*(0:8)*pi*(N-1)/N),zeros(1,23),exp(i*(N-(32:39))*pi*(N-1)/N)]
Lw=L.*hamming(N)';
[H,F]=freqz(Lw,1,512,fp);
P=angle(H)*180/pi;
plot(F,P);
grid on
Opóźnienie fazowe
fp=2000;
fodc=400;
f1=50;
N=fp/f1 ;
deltaf=fp/N
H=[exp(-i*(0:8)*pi*(N-1)/N),zeros(1,23),exp(i*(N-(32:39))*pi*(N-1)/N)]
h=ifft(H)
L-[h];
Lw=L.*hamming(N)';
M=1;
phasedelay(L,M,512,fp);
grid on
Filtracja
Sygnał zaszumiony
N=40;
fodc=400;
fp=2000;
t=(0:(1/fp):0.16);
signal=5*sin(100*pi*t)+2.5*sin(2*pi*(fodc+150)*t);
plot(t,signal)
grid on;
Furier
N=40;
fodc=400;
fp=2000;
t=(0:(1/fp):0.16);
signal=5*sin(100*pi*t)+2.5*sin(2*pi*(fodc+150)*t);
Le = length(t)-1;
signal1 = abs(fft(signal))/(Le/2);
ff = 0:(fp./Le):fp;
plot(ff,signal1)
grid on;
Filtr NOI
gr=10;
wga=0.7874;
fp=1000+gr*100;
fgc=200+gr*10;
wgc=2*pi*fgc;
Tp=1/fp;
A=wga*(1/tan(wgc*Tp/2));
L=[1 2 1];
M=[(1+1.73*A+A^2) (-2*A^2+2) (A^2-1.73*A+1)];
N=40;
fodc=400;
fp=2000;
t=(0:(1/fp):0.16);
signal=5*sin(100*pi*t)+2.5*sin(2*pi*(fodc+150)*t);
signal1_f = filter(L,M,signal);
plot(t,signal1_f)
grid on;
gr=10;
wga=0.7874;
fp=1000+gr*100;
fgc=200+gr*10;
wgc=2*pi*fgc;
Tp=1/fp;
A=wga*(1/tan(wgc*Tp/2));
L=[1 2 1];
M=[(1+1.73*A+A^2) (-2*A^2+2) (A^2-1.73*A+1)];
N=40;
fodc=400;
fp=2000;
t=(0:(1/fp):0.16);
signal=5*sin(100*pi*t)+2.5*sin(2*pi*(fodc+150)*t);
signal1_fw = abs(fft(signal1_f))/(Le/2);
plot(ff,signal1_fw)
grid on;
FILTR SOI
fp=2000;
fodc=400;
f1=50;
N=fp/f1 ;
deltaf=fp/N
H=[exp(-i*(0:8)*pi*(N-1)/N),zeros(1,23),exp(i*(N-(32:39))*pi*(N-1)/N)]
L=ifft(H);
signal1_f = filter(L,H,signal);
plot(t,signal1_f)
grid on;
fp=2000;
fodc=400;
f1=50;
N=fp/f1 ;
deltaf=fp/N
H=[exp(-i*(0:8)*pi*(N-1)/N),zeros(1,23),exp(i*(N-(32:39))*pi*(N-1)/N)]
L=ifft(H);
signal1_fw = abs(fft(signal1_f))/(Le/2);
plot(ff,signal1_fw)
grid on;
WNIOSKI