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

**URL:** <https://forum.plexim.com/t/how-can-i-see-the-magnitude-and-frequency-of-signal-dft/911>\
**Category:** PLECS\
**Tags:** scope, fourier\
**Created:** [December 3, 2020, 6:07am UTC](https://forum.plexim.com/t/how-can-i-see-the-magnitude-and-frequency-of-signal-dft/911 "2020-12-03T06:07:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EMdude](https://avatars.discourse-cdn.com/v4/letter/e/71c47a/32.png) [@EMdude](https://forum.plexim.com/u/EMdude)\
**Post date:** [December 3, 2020, 6:07am UTC](https://forum.plexim.com/t/how-can-i-see-the-magnitude-and-frequency-of-signal-dft/911/1 "2020-12-03T06:07:22Z")

</div>

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

 ![20](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/1X/b87f6fd7453a2be2a9caa472da0c9b3d3e5bee1d.jpeg)

here is the results on scope: DFT\_plecs\_2

 ![20](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/1X/1a32b364379c66d1fe47eb95129d620291c4cd36.jpeg)

Thank you

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [December 3, 2020, 9:31am UTC](https://forum.plexim.com/t/how-can-i-see-the-magnitude-and-frequency-of-signal-dft/911/2 "2020-12-03T09:31:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![EMdude](https://avatars.discourse-cdn.com/v4/letter/e/71c47a/32.png) [@EMdude](https://forum.plexim.com/u/EMdude)\
**Post date:** [December 7, 2020, 3:57am UTC](https://forum.plexim.com/t/how-can-i-see-the-magnitude-and-frequency-of-signal-dft/911/3 "2020-12-07T03:57:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [December 7, 2020, 1:37pm UTC](https://forum.plexim.com/t/how-can-i-see-the-magnitude-and-frequency-of-signal-dft/911/4 "2020-12-07T13:37:39Z")

</div>

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](https://forum.plexim.com/uploads/short-url/ljMEK83XkuAZfl2KH7os2UJqEql.plecs) (6.41 KB)

---

<div class="post-metadata">

**Author:** ![EMdude](https://avatars.discourse-cdn.com/v4/letter/e/71c47a/32.png) [@EMdude](https://forum.plexim.com/u/EMdude)\
**Post date:** [January 15, 2021, 8:52am UTC](https://forum.plexim.com/t/how-can-i-see-the-magnitude-and-frequency-of-signal-dft/911/5 "2021-01-15T08:52:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [January 15, 2021, 12:29pm UTC](https://forum.plexim.com/t/how-can-i-see-the-magnitude-and-frequency-of-signal-dft/911/6 "2021-01-15T12:29:20Z")

</div>

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?
