Help with fir1 needed
Mostrar comentarios más antiguos
I have this code: nfilt=128; wnm=[cLw cHi]/15000; bm = fir1(nfilt,wnm); y_filteredm=filter(bm,1,data);
for the values wnm =[0.533300000000000 1] I get bm = NaN and for wnm = [0.844444444444445 1.00000000000000] I get the error "Frequencies must fall in range between 0 and 1." after I try to calculate bm. What did I do wrong?
Respuestas (2)
Honglei Chen
el 13 de Nov. de 2014
Did you compute wnm from some other functions? This looks like a round off numeric issue. A simple fix could be adding the following line before you invoke fir1
wnm(wnm>1)=1
Ges1234
el 14 de Nov. de 2014
0 votos
1 comentario
Honglei Chen
el 25 de Nov. de 2014
The doc does say Wn needs to be between 0 and 1, not inclusive. You can also see it if you do
>> help fir1
HTH and sorry I didn't make that connection in my previous answer.
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!