Reputation: 3
I need to filter a time domain simple signal through a analog low pass filter which i have designed. I need the output signal in time domain.
%LPF
order=3;
ripple = 1; %pass band ripple
f_c= 22e6;
[num1, den1] = cheby1(order, ripple, 2*pi*1.10*f_c, 'low', 's');
%Create input signal
Fs=200e6;
Ts=1/Fs;
NFFT=2^12;
Runtime=(NFFT-1)*Ts;
t=0:Ts:Runtime
a_in=1;
phase_in=0;
y_in=a_in*sin(2*pi*fin*t+phase_in); % 4096 points
I need the output signal y_out
in time domain of 4096 points. What do I need to do?
Upvotes: 0
Views: 521
Reputation: 1593
I think you have to use the filter()
function of the signal processing toolbox. It takes the filter coefficients and the signal to be filtered as arguments:
y = filter(b,a,x)
where b
are the numerator coeffiecients, a
is the denominator and x
the signal to be filtered. The output vector has usually the same size as the input, so since your input is 4096 samples, also your output will be 4096 samples. More info here.
So in your case:
y_out = filter(num1, den1, y_in)
Upvotes: 2