Matlab functions / m files for sample by sample filtering using a digital IIR filter

5 views (last 30 days)
Hi All,
I want to implement an butterworth low pass filter to filter a DC component of a signal inside a phase locked loop. The process is done in sample-by-sample basis. Therefore I have to filter the signal sample by sample (Not the whole signal or block by block). I have implemented a filter to filter the whole signal. I couldn't make it to work sample by sample basis.
I highly appreciate if someone can advice me regarding this issue. I have included the code Im using to filter.
[b,a] = butter(2, 4*fc/Fs); % 2nd Order butterworth filter coefficient generation (Cutoff frequency is 2*fc)
x=filter(b,a,y); % y is the input signal.
% Here these two lines do the perfect filtering operation for the entire signal, But I want to process sample by sample (In-side a phase locked loop)
Can someone please advice how to do that using available matlab function or different approach?
Thanks.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!