LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error 20309

I get this same error in a .vi I wrote to pull data off a channel of an Oscope. It happens with any DC signal (whether zero or not) inputted to the built in FFT Power Spectrum and PSD.vi. I know that this is because the Fourier transform of a continuous DC signal is the Dirac delta function which is infinite at frequency identically equal 0 and zero everywhere else. However when ever this happens I would like for the .vi not to throw an error to the user. I can contrive a plot with the value at DC going to some huge number say a million or a billion at DC and show zero everywhere else. However what I would really like to do is show an upward arrow on the graph at DC which is usually how the Dirac delta function is portrayed but I don't know if LabView allows a way to show a symbol on a graph. I guess I can mathematically draw an arrow but ideally I would like to use some predefined symbol.

0 Kudos
Message 11 of 14
(285 Views)

Hi Mike,

 


@mikethemartian wrote:

However when ever this happens I would like for the .vi not to throw an error to the user.


Handle the error programmatically…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 14
(267 Views)

I just used a for loop to check if the signal is purely DC and then a case structure to use graph annotations to make an ad hoc Dirac delta.

0 Kudos
Message 13 of 14
(258 Views)

I believe you are thinking about the Discrete Fourier Transform (as exemplified by the Fast Fourier Transform, or FFT) incorrectly.

 

The FFT is usually used to analyze the frequency components of an ongoing continuous signal sampled at a fixed frequency for a finite (usually a power-of-2) samples.  The "buried" assumption is the signal has no "step", so can be characterized by N/2 - 1 "gain/phase" (or "sine/cosine") components + a DC term + a "noise" term (since the sampling has digitization error).

 

If, on the other hand, you are "exciting" the system by "hitting it with a hammer" (or introducing a step or impulse input) and want to measure the response to this input, you can synchronize your sampling to start at the time of the stimulus and do a post-stimulus FFT.  Note that hitting something with a hammer will produces "vibrations" which can be analyzed via the FFT, but you need to remember that the FFT gives you the frequency response over the entire sampling interval.  So if you sample 1000 samples at 1 kHz for 100 seconds, if you look at the first 1000 samples, that will give you the frequency spectrum from 0 to 1 second.  You then slide the sampling window down by, say, 100 samples, and get the frequency spectrum from 0.1 to 1.1 second, slide, FFT, plot.  This is called Time-Frequency Analysis, and is a somewhat advanced technique.  [One common use is a "sound spectrogram", such as the analysis of speech or music, which involves time-varying changes in frequencies of the waveform.

 

Bob Schor

0 Kudos
Message 14 of 14
(246 Views)