11-20-2021 03:33 AM
Hello
I have a problem how to plot FFT properly. I want to make a simulation of dynamic system and I have tried memory and collector to get signal out of simulation loop but every time the plot happens to be incorrect. I have no idea what I do wrong. Here I attach a simple example.
Simulation time is 2 s and although sine frequency is 25 the plot shows 50.
Thanks in advance.
11-20-2021 06:18 AM - edited 11-20-2021 06:19 AM
Hi Tairux,
there are several things wrong:
11-20-2021 06:45 AM
Right, my bad. I will attach my VI. Besides that I also tried with "Spectral Measurements" block and "Spectrum (Mag-Phase)" block but I am not sure which is best for my application. I mean I don't know exactly how to handle getting signal out of simultion loop to make FFT function work.
Thanks for reply.
11-20-2021 02:01 PM
You want to simulate a signal. LabVIEW has a data type called a Waveform that includes three elements -- the time (t0) at which the data were acquired, the sampling interval (dt), in seconds, between samples (so it would be 0.001 if you are sampling at 1 kHz), and an Array of Dbls (Y) containing however many Samples you acquired at a time (for example, sampling at 1 kHz for 1 second would give you an array of 1000 samples).
When you analyze a signal to get Spectral Data, you need to "scale" the results according to the sampling Frequency (or sampling Interval, 1/f). If you look at the Block Diagram Palettes, you'll see one called "Waveform". Look inside at Analog Wfms/Generation and choose "Simulate Sig", an Express VI that will simulate a Signal for you that you can feed into your Spectral Measurements Express VI. This should work better for you.
Bob Schor
11-21-2021 10:36 AM - edited 11-21-2021 10:36 AM
Hi Tairux,
see this after reading Bob's message:
@Tairux wrote:
Besides that I also tried with "Spectral Measurements" block and "Spectrum (Mag-Phase)" block but I am not sure which is best for my application.
You should know on your own what is best for your application!
(How should we know that?)