I have a real time signal, a new sample is coming continuously and needs to be filtered before further processing. I want to design the filter in C. But I don't have much experience in C.
Could someone give an simple example of C-code so that I can go further. e.g., I need to filter the real time signal with a low pass filter of 15 Hz. The sampling rate is 450 Hz.
// Return RC low-pass filter output samples, given input samples,
// time interval dt, and time constant RC
function lowpass(real[0..n] x, real dt, real RC)
var real[0..n] y
var real α := dt / (RC + dt)
y[0] := x[0]
for i from 1 to n
y := α * x + (1-α) * y[i-1]
return y