My previous question wasn't clear. So I thought it'll be good idea to repost with more details.

I've designed a 100th order windowed highpass FIR filter with 3Hz cutoff frequency for my ADC datas with 100Hz sampling rate. I am currently stacking up my datas in a buffer. Then convolve that buffer with my FIR coefficients array. Lastly, take FFT of the output of convolution. This way works pretty well. I can see clearly the respond that I wanted from FIR filter. However since output is an array, I can't display that to represent my time domain graph.

Since I'm working on a real-time data plotting, I need to send filtered time domain values one by one to show them in my plotting application. To get a single output I've tried to reduce my adc datas' array size to filter's array size and implement $y(n)=h_0x(n)+h_1x(n-1)+\ldots +h_{N-1}x(n-N+1)$ this instead of convolution.

I gave 3Hz 0.2V amplitude sine wave signal with 1V DC offset. I've recorded the result in a video. In the video, you can see it removes the DC offset and amplitude is right but the wave is no longer a sine wave. Later in the video, I've changed the frequency to 1Hz and it cutted off the signal which was expected. In the frequency domain everything is wrong because it shows same frequency values no matter what real frequency is.

  • $\begingroup$ What project is this? Why do you need real-time data visualisations? $\endgroup$ – Fat32 Sep 11 '17 at 12:36
  • 2
    $\begingroup$ @PeterK. I've solved the problem. I appreciate your help. It was happening because of ADC data containing array was not properly sorted according to the time. $\endgroup$ – Pyro Sep 11 '17 at 13:23
  • 1
    $\begingroup$ @Fat32 I'm going to monitor some vital signals about health such as respiratory rate. $\endgroup$ – Pyro Sep 11 '17 at 13:24
  • $\begingroup$ Good ok... Your filtering approach seems a reasonable one... $\endgroup$ – Fat32 Sep 11 '17 at 15:53

The green output in the video looks like it's just the blocks of the filtered data, with transients at the beginning of each block. That's probably why the spectrum always looks the same, you're just seeing the blocking artifact / frequency. You are probably starting the filtering from scratch every time, whereas you need to keep the data (state) of the filter from one block to the next.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.