ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Spectrum analysis, strange behaviour

Solved!
Go to solution

Hi!.

I've created this VI that perform a spectral analysis of a simple sinusoidal signal of wich I can change the frequency in a range from 100 to 1000 Hz.

I've noted that if I choose a frequency's value like 340,350,..., 460... and so on, I see in the spectral graph exactly the expected signal's amplitude value, in this example: 4

uno.png

Instead, If I set a value like 341, 342, 343,... and so on until the next "round" value I don't see the same exact amplitude value (4) but a lowest value and the graph is more scattered around the max value:

due.png

 

Any idea?

Thanks in advance

0 Kudos
Message 1 of 6
(3,318 Views)
Solution
Accepted by topic author mforbiz

You take 1000 samples which is 100 ms of data; your frequency resolution is 10 Hz. When your frequency doesn’t fall exactly on a 10 Hz bin, it is spread out over multiple bins depending on the window.

 

mcduff

Message 2 of 6
(3,293 Views)

McDuff is right, add another 0 to your sample rate and you'll get perfect 1-Hz matching again.

0 Kudos
Message 3 of 6
(3,281 Views)

You only get a single line if the sample contain an integer number of cycles.

If you don't have an integer number of cycles in the signal, you get spectral leakage.

 

 

0 Kudos
Message 4 of 6
(3,244 Views)

Hi mcduff.

Sorry for delay.

You're right.

I'll try with windowing

Thanks

0 Kudos
Message 5 of 6
(3,183 Views)

Hi Bert.

I think you intend to add another 0 to number of sample.#Sample.png

0 Kudos
Message 6 of 6
(3,182 Views)