09-21-2016 10:38 AM
Hi,
I create simple program which generate signal.
1 singal: Sine Frequency:5Hz Amplitude:1
2 singal: Sine Frequency:1Hz Amplitude:0,8
3 singal: Sine Frequency:100Hz Amplitude:0,5
The signal is the sum of 3 of these signals.
Why in my program i can't see correct amplitude value in FFT spectrum? For example i can see on graph 0,12 for amplitude 0,5.
What is more, after filtration i can't see correct value frequency. For 100Hz is 0.1. Why?
Regards
09-21-2016 10:58 AM
Because filters don't have sharp cutoff frequencies.
Your filter is set for 0.125 (with sampling rate 1, or 125 for sampling rate of 1000) (Your VI would be easier to work with if you used the same sampling rate input into the filters as you used for creating the sinewaves.)
At the filter point, you have some attenuation of the signal that is -3db. If you want to have.
Learn more about filters here. https://en.wikipedia.org/wiki/Low-pass_filter
09-21-2016 11:17 AM
But if i don't active a Case Structure with filters the FFT after filtration still show a 0,1 for 100Hz.
How to resolve?
09-21-2016 12:17 PM
When I run your VI with both buttons off, and thus no filter, both the before and after FFT's show 0.125
09-21-2016 01:02 PM
My sampling info in Sine waveform is set:
Fs: 1000
#s: 1000
So can you easily explain where change value and what and why such a value?
I would be very grateful.
09-21-2016 01:33 PM
Which creates an array of data. You then fed that array into the filter, but told the filter your sample rate is 1, not 1000.
When you do the later FFT, it is working on the raw array data and assumes the sample rate is 1, whereas the original FFT used the waveform wehre the dT in the waveform was 1/1000.
09-22-2016 02:30 AM
I create array of data and didn't work:/
09-22-2016 08:47 AM
In what way didn't it work? Statements like that don't tell us anything. Did it cause an error? Did it just not give the results you were expecting?
I ran your VI and I see an error on the bottom sine wave creator.
"Error -20061 occurred at NI_MABase.lvlib:Sine Waveform.vi:2090004 >> NI_MABase.lvlib:ma_Trap Fgen Parameter Errors.vi:5950001
frequency must be <= sampling rate/2"
Your frequency is 100 and the sampling rate is 100. I changed the frequency to 40 (less than 1/2 of 100) and that error went away. Then I found an out of memory error. Because you have a 0 in Number of samples, and subtracting 1 give a -1, the while loop never stops because it is never equal to i because i starts at 0. I put another number in for "number of samples", then the VI runs.
What is the point of the that while loop, anyway?
09-23-2016 02:25 AM
... creating a array subset. Use "Array Subset" or "Delete From Array" instead - it is more effective. And you can try to look into e.g. http://www.ni.com/white-paper/5509/en/ (to get more insinght into signal theory).