I am having some problem in using a filter.
I designed a specific filter using the following commands
fs = 200;
fpass = [0.45 40] ;
fstop = [0.4 45];
Wp = fpass *(pi/fs);
Ws = fstop *(pi/fs);
Rp = 0.1;
Rs = 20;
[N, Wn] = cheb1ord(Wp, Ws, Rp, Rs, 's');
[B, A] = cheby1(N, Rp, Wn, 's');
[H, w] = freqs(B, A);
semilogx(w*fs/pi, 20*log10(abs(H)) );
ylabel('Amplitude (dB)', 'FontSize',16)
Now, looking at the filter, I decide that the filter is what I desire and to avoid the phase shift I want to use the filtfilt command (I know this will double the filter order, right?, but I took this in account in designing my filter specs), therefore I do
Data_filt = filtfilt(B,A,Data);
The problem is that Data_filt is a vector with all NaN
I have seen few threads on problems that are similar to this, but I could not figure out a definitive solution.
Can someone help with this?
Many thanks in advance