03-21-2024 08:05 AM
I am trying to take a digitized sine wave and then plot the magnitude and the phase of its FFT spectrum separately. However, the phase plot I am getting does not seem to be correct. I have attached my VI for reference.
03-21-2024 09:57 AM
Your Vi is one version newer than I have so I can't open it.
Anyway, what results you are expecting doing a frequency (FFT) analysis on a sine wave?
A sine wave only contains the fundamental frequency. Try a more complex waveform.
03-21-2024 10:24 AM - edited 03-21-2024 10:29 AM
When attaching a VI, make sure that all controls have typical default values. Currently, your frequency, sampling rate, and # of samples are all zero. Please tell us what input values you are suing and what you expect as result.
You are using an FFT function that expects a waveform, but you give it a naked 1D array, i.e. no timing information at all. The FFT thus assumes a dx of 1. (did you notice the red coercion dot?)
Also make sure to place a small wait inside your loop (e.g. 100ms) because it seems pointless to repeat the same calculation millions of times per second, burning 100% of a CPU core.
03-21-2024 10:29 AM
Thank you for the suggestions. I am using the following values:
No. of Samples: 100
Signal Frequency: 100
Sampling Rate: 1000
03-21-2024 10:31 AM
What I dont understand is the phase plot. Isnt it suppose to be at pi/2? Here is my block diagram:
03-21-2024 10:39 AM
03-21-2024 10:56 AM
There are two main issues:
See if this can give you some ideas:
03-21-2024 12:20 PM
I have been asked to used the sin function and not the sine waveform generation sub vi
03-21-2024 01:45 PM
You can built your array into a waveform by just defining dt, right?
03-21-2024 02:05 PM
yes, that should result in an array