how can I see the magnitude and frequency of signal(DFT)?

hello everyone,

I am trying to obtain the Fourier transform of signal by using the DFT of PLECS but I got some weird result.

so here is very simple sinewave generator and the DFT block: DFT_plecs_1

here is the results on scope: DFT_plecs_2

Thank you

Hello, just to be clear- is the signal you are trying to analyze a single (frequency) pure sine wave, therefore with no harmonics? If so, I’m not sure a DFT would be very interesting in this case?

Hello Kris,
Yes I want first to try if the DFT of signal with single frequency is working. but I think it does not.

my real signaI want to test is a sinewave but with some distorion in half of the sinewave. I want to analyse those harmonics

Hello,

It looks like you are using an older version of PLECS as the Fourier Transform component has recently been updated (as in my attached model). I recommend that you update to the latest version as this is now easier to use. Regardless, I’m not sure your model makes sense still- what is the duration of your simulation? If it is the default of 1 second, the sampling time of 8 seconds shown in your image will not be meaningful. Further, I would need to see your model, but I think your fundamental frequency of the averaging is set to 1/(8*8) = 1/64 Hz.

In my attached PLECS Standalone model I have two frequencies overlaid of 10 and 20 Hz and the Fourier shows the expected results of the first (base) and second harmonic in the Scope.

Let me know if this feedback helps to clarify your questions.

Best,

Kris

basic_ft_example.plecs (6.41 KB)

Hi Kris, Thanks for your response. I made a mistake the first circuit. it the sampling frequency is 1/8 s and the fsignal=1Hz.
might I ask what is the fundamental frequency?

If the frequency of the signal you are sampling is 1Hz, then that is the fundamental frequency for the FT block. Or am I not understanding your question?