I am currently trying to window an analog IIR filter in order to obtain an FIR filter. Though I realize the fir1 function exists within Matlab, I was wondering to see if it could be done step-by-step to produce a notch filter at 0 Hz to eliminate any DC gains in the system. However, I quickly realized that I may not know what I'm doing :)
Firstly, I created a butterworth filter containing the characteristics that I'm looking for just for a comparison. Once the Chebyshev II analog filter was created, the magnitude and phase response was viewed. It doesn't show a bandstop at 0 Hz, but my guess is because it hasn't yet been windowed to show this result? I also wasn't too sure how to combine the window and analog filter, and would love it if someone pointed me in the right direction :(
Fs = 250;
n = 5;
Rs = 40;
Wn = [0.1*2/Fs, 0.2*2/Fs];
[b0,a0] = butter(3,Wn,'stop');
[b1,a1] = cheby2(n,Rs,Wn,'stop','s');
freqz(b0, a0, 4096, Fs);
w = triang(250);
y = filter(b1,a1,w);