iirnotch filter notch depth

14 vues (au cours des 30 derniers jours)
Daoyuan
Daoyuan le 15 Déc 2014
Modifié(e) : Daoyuan le 15 Déc 2014
Hi,
I am quiet new to this, I am currently using a iirnotch() filter for 60 Hz sin wave. The code typically looks like this:
in_fs=160;
in_f=60;
in_t=0:1/in_fs:1;
input = 8388607*sin(in_t*in_f*2*pi);
wo = in_f/(in_fs/2); bw = wo/15;
[b,a] = iirnotch(wo,bw);
fvtool(b,a);
filterOut = filter(b,a,input);
fvtool(input);
fvtool(filterOut);
*note freqz() plots similar graphs
From the original notch filter graph, it shows that the notch has a depth of more than -60dB, however when I apply to the input, the second graph shows that the dB drop is only by about 20 dB, if I plot the time domain output, I do see a large difference, but should this notch create a larger drop at 60 Hz?
I tried to increase the number of sampling points for better resolution, but it made no difference. The q factor is set based on my project's specifications. I am just wondering why the output of the filter doesn't have a 60 dB lower sin wave?
Thank you in advance for any help.
  1 commentaire
Daoyuan
Daoyuan le 15 Déc 2014
Modifié(e) : Daoyuan le 15 Déc 2014
hmm, I sort of figured out the solution, I don't seem to understand it though. I increased the number of input points from
in_t=0:1/in_fs:1;
to
in_t=0:1/in_fs:20;
(number of points used in freqz or fvtool is 144000)
That gave a notch of -60 dB. I am confused, since the notch filter is only second order why do I need so many points (3200 input points) to allow the filters create the -60dB drop. Also does this mean that when I apply this using IIR filtering in C, I also need at least 3200 input samples to allow the notch drop -60dB? OR is the number of input samples an issue to do with the fvtool to display the notch and the results?

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by