How to utilise digital filter for raw adc data

Status
Not open for further replies.

karan

New member
i have raw adc data for teensy 3.6.i want to apply filter(ex. Biquad filter) and after that want to print filtered data to serial monitor port.is there any way because audio library is directly taking reading from adc and there is no option to send filtered data on serial port
 
Have a look at the "record queue"-object, which allows you to send realtime audio data from an input (eg. the internal ADC) to the queue object.

You will find an example how to use this object in Audio->examples-> Recorder [instead of recording the data onto an SD card, you can simply take the data and print it out on the Serial Monitor for your purpose]
 
Do you need the audio library at all? Since you've started with the audio library, we can assume the frequency you're interested in is not too high. You could just take raw analog readings every so-many micro-seconds and implement the transfer function directly...
Code:
inline float Biquad::process(float in) { // direct form II transfer function example (I think)
    double out = in * a0 + z1;
    z1 = in * a1 + z2 - b1 * out;
    z2 = in * a2 - b2 * out;
    return out;
}

Assuming it's a static filter and you can get the coefficients sorted; otherwise there are libraries like the one it nicked this transfer function code from that will do that for you too if you need to process conventional filter parameters.

But what do you mean by filtered data? A time series? At what rate and why on the serial port?

Being a bit more explicit about the problem you're solving might get you better advice (and from better sources than me!).
 
on teensy 3.6 board on pin A22 i have analogue signal input,i want to filter this signal(16666hz + noise) to remove noise and want to use output filter data(signal) to derive data.
 
Status
Not open for further replies.
Back
Top