Hello, I'm trying to filter signals. I put a photo of an example of a square signal of 50Hz. I have done the FFT to confirm bandwidth. I use frequency_sample=150Hz>frequency_high. frequency_high=60Hz and frequency_low=40Hz and I haven`t results?
Can you help me? I can't understand what I'm not doing ok. I send you my file and a photo of the result.
What are you filtering your signal???? Do you want to subtract DC component, or high freq. components? Because it seems to me that the output signal you get, is actually the 50 Hz square wave filtered!!
1. Set the sampling frequency of your filter to the same rate as the data acquisition sampling (25000 Hz in your VI).
2. As Graziano suggested, use a low pass filter. A pure square wave has only odd harmonics (as your spectral graph shows) so a cutoff frequency of about 100 Hz should be a good starting point.
3. You are reading the DAQ buffer about 5 times per second. If the data changes very much during that time a user might have a difficult time observing the changes. Often it is useful to have two loops in parallel. One does the data acquisition and the other does the processing and display. The data can be transferred from one to the other via a queue or a functional global. If the data is saved in a buffer or file, the user can display it at a rate which is different from the rate at whiich it is acquired.
Hi! I wrote a rapid answer... of course, johnsold's answer is more complete!
To complete your DSP, I can only add: never forget to low-pass filter the signal you'are acquiring!!!!, if sampling rate is 25000, it can be good to put a lowpass filter with cf=20 kHz, unless you will obtain aliasing! I don't know if DAQ board you're using has one built-in....