Cut-off frequency not reached with my equiripple-filter
Mostra commenti meno recenti
Hi, I am new to filter design and I have designed an equiripple filter in matlab using the commands:
Hd=fdesign.lowpass('Fp,Fst,Ap,Ast',30000000,50000000,1,60,1000000000);
d=design(Hd,'equiripple');
With a passband frequency of 30MHz and a stopband frequency of 50MHz. However, when I filter the signal
x=1:100000;
y=2+sin(1000*x)+5*sin(1*10^9*x);
with the command
h=filter(d,y);
both sine-functions are reduced. But sin(100*x) should go through and I don't understand why it doesn't. Does anyone know what I am doing wrong?
Thanks Jenny
Risposta accettata
Più risposte (3)
Wayne King
il 13 Giu 2012
I don't see that with your unit step time vector, your frequencies in
y = 2+sin(1000*x)+5*sin(1e9*x)
are appropriate. What frequency do you think sin(1000*x) is?
Your x vector has unit steps. If we translate this to your sampling frequency (used in your filter design) of 1 gigahertz, then these frequencies are aliased.
f = 1000/(2*pi)
Now with a unit step that means it has a period less than 1 sample. The period of sin(1000*x) is (2*pi)/1000. That's above the Nyquist considerably and therefore so is sin(10^9*x) even more so.
Why are you defining your signal like this? Why not use a time vector where you use the sampling interval that corresponds to your sampoing frequency?
Fs = 1e9;
t = 0:1/Fs:(1e5*(1/Fs))-(1/Fs);
I just set up t to be the same length as your original x.
Now define your sine waves over the t vector.
Jenny Eriksson
il 14 Giu 2012
Jenny Eriksson
il 14 Giu 2012
0 voti
Categorie
Scopri di più su Digital Filter Design in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!