From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sweep Sine Amplitude decreases

Solved!
Go to solution

Hi All.

 

Why is the amplitude of my Sweep Sine decreases?

 

I wonder why increasing my number of samples, which is in my VI set to 51200 samples, results to an output amplitude of my sweep sine to decrease. However if my number of samples is small, let's say 1000 samples, the output amplitude from the Tone Measurements VI is close to one which is 0.968709.

 

How can I adjust in order to have the correct value of the amplitude. I need the amplitude to be exactly one, because I will output this in my DAQ. 

 

Here is my VI.

 

Untitled.png

 

 

 

0 Kudos
Message 1 of 8
(3,807 Views)

Your sampling rate is ~2.5x your highest sweep frequency.  While that meets the Nyquist requirement to find the frequency, you generally won't find the correct shape of a wave with such a minimal frequency.  You want to be somewhere 10x the frequency or higher, if possible.  Once you reach the 10x point, you get to a realm where you can start to consistently put the shape of the wave together.

0 Kudos
Message 2 of 8
(3,787 Views)

Even if I set my Fs, sampling frequency to be 10x greater than my highest freq. When I increase the number of samples, the amplitude really decreases.

0 Kudos
Message 3 of 8
(3,781 Views)

Try a ratio of 10:1 Fs:#samples.

 

That's usually about the sweet spot.

0 Kudos
Message 4 of 8
(3,760 Views)

Obviously your chriped sine getting to 1,-1 - very close to those values of amplitude, your just not able to see it, try to see it with comparison that will light when the values of the amplitude are bigger , let's say than 0.999. 

0 Kudos
Message 5 of 8
(3,754 Views)

The problem is I need to connect this chirp signal to a Play Waveform VI. If I have a ratio of 10:1 for the Fs:#samples, I'm getting a sound that is not continuous. 

0 Kudos
Message 6 of 8
(3,736 Views)

Although I agree with the sampling rate discussions above, you might consider normalizing the output of the Swept Sine to One? There is even a built in VI for it: "Normalize Waveform.vi"

Sam Shearman - Sam.Shearman (@) gmail.com
0 Kudos
Message 7 of 8
(3,728 Views)
Solution
Accepted by jamison.suade

The use of Tone Measurements.vi is largely meaningless. Read the help for that VI.  It finds the frequency where the amplitude is the largest. It uses Fourier transform techniques to find that frequency. The Fourier transform of a chirp ideally is a constant. Because the actual chirp does not cover an infinite frequency range and last for infinite time, the spectrum is modified by the effective window. Thus the peak of the spectrum is approximately at the center of the frequency range.

 

Drop a spectral measurement VI on the block diagram and plot the spectrum.

 

When I extract a subset of the chirp array and feed that to Tone Measurements I get much more reasonable values. Subset starting at sample index 15000 and having length 50 samples returns Frequency = 5876.21 and amplitude = 0.99999. The graph shows about 5 3/4 cycles in about 1 ms, which is consistent with the measured frequency.

 

Lynn

Message 8 of 8
(3,686 Views)