- “fir1” normalizes the coefficients as described here . Adding another argument to function changes this: fir1(order,Fc,'low',rectwin(L),'noscale').
- The Hd_n vector has coefficients can be corrected by changing (sin((n-Tau)*Fc)) to (sin(pi*(n-Tau)*Fc)). The lack of pi expands the area under curve.
- Hd_n(Tau+1) = Fc corrects the magnitude at center frequency.
Comparing FIR1 bultiin function for generating coefficients with my Function.
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ahsen Noor Subhopoto
le 11 Juil 2019
Commenté : Ahsen Noor Subhopoto
le 3 Août 2019
Hi, I am trying to create my own FIR1 by using Window functions but somehow I am not getting the exact results. I have shared the codes with corresponding outputs here;
%Window function is Rectangl, W(n) = 1;%
order = 10;
L = order + 1; %length of a Window
Tau = ceil((order-1)/2); % Tau = 5
Fc = 0.99 %for simplicity that is close to 1
%Builtin Function%
Rectangl = fir1(order,Fc,'low',rectwin(L));
%My function%
n = 0:1:order;
Hd_n = (sin((n-Tau)*Fc))./(pi*(n-Tau));
Hd_n(Tau+1) = Fc/pi;
[Hd_n' Rectangl']
%end
Output:
Both outputs are different. Like, Hd_n(1) = -0.0619, whereas Reactangl(1) = 0.0099.
Am I doing something wrong ? Your suggestions and debugging will be helpful for me.
Thank you,
0 commentaires
Réponse acceptée
Kaashyap Pappu
le 26 Juil 2019
The difference between the 2 filter coefficients arises for the following reasons:
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matched Filter and Ambiguity Function dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!