Wednesday, July 3, 2019

decimation - How to design very narrow band, very sharp low pass filters - Only DC needed?


I am using a DSP processor to sample signals at 108kHz and I only want to get the DC part out of it. Such a high sampling rate is used because I want to use oversampling to reduce quantization noises.


Two filters are to be designed:



  • One has 10Hz stop-band frequency; new data are read every 0.1 second;

  • One has 0.1Hz stop-band frequency; new data are read every 10 second;



What I did


I used several stages of decimation and downsample the signals to 300Hz. Then I use FIRs to filter the signal:



  • For the 10Hz bandwidth: 128 stage filters are used

  • For the 0.1Hz bandwidth: 768 stage filters are used.



Performance is the most important to me: The sharper low-pass filters are, the better.




  • Could I ask for suggestions in implementing such a filter?

  • Is it possible to design a 0.01Hz low pass filter? If so, the new data can be read every 100 seconds?

  • I heard that using IIRs could be a solution, is it?


Thank you very much!



I tried to compare with matlab:


Setting 1: %Use Matlab fir1 function





size = 1080000; h = fir1(size, 0.00000000001); fvtool(h) FIR1




Setting 2: %Build an averaging FIR




size = 1080000; h = ones(1,size); h = h *1/size; fvtool(h) average




The theory should be both two settings have similar performance. However, it seems that fir1 has narrower stopband than the simple average filter. It seems that the average DC filter will include more noises.




Answer



The definition of the Fourier Transform of a function $x(t)$ is


$$ X(f) \triangleq \int\limits_{-\infty}^{\infty} x(t) \, e^{-j 2 \pi f t} \, \mathrm{d}t $$


Evaluating for $f=0$ you see


$$ X(0) = \int\limits_{-\infty}^{\infty} x(t) \, \mathrm{d}t $$


As you can see the value at DC equals the area of the function.


The definite integral of a function from $-\infty$ to $\infty$ is equal to the transform at the origin $X(0)$.


This may help you if you don't have streaming data. Instead of a sharp lowpass filter or taking the fourier tranform and extracting $X(0)$, just integrate your data and the result is equivalent to obtaining $X(0)$.


No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...