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;
order = 10;
L = order + 1;
Tau = ceil((order-1)/2);
Fc = 0.99
Rectangl = fir1(order,Fc,'low',rectwin(L));
n = 0:1:order;
Hd_n = (sin((n-Tau)*Fc))./(pi*(n-Tau));
Hd_n(Tau+1) = Fc/pi;
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.