The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Simulators >> System Simulators >> some MATLAB DFT questions https://designers-guide.org/forum/YaBB.pl?num=1321893702 Message started by SoliS on Nov 21st, 2011, 8:41am |
Title: some MATLAB DFT questions Post by SoliS on Nov 21st, 2011, 8:41am Attached is a plot of a DFT I generated in MATLAB. The input is just a sine wave at 10kHz, generated with MATLABs sine function. I am wondering why there is a 20 dB/decade roll off characteristic after the 10 kHz peak; I would expect just a flat noise floor. I am not too familiar with the intricacies of the FFT/DFT. I ask this because I am trying to apply 2 low pass filters (RC networks) to the sine wave by using the discretized version (difference equation). When I apply the filters, I do not see the characteristic 20db/dec roll off that I expect; the second filter should give 40 dB/dec, but they all have the same slope and I think something in the DFT is obscuring it. |
Title: Re: some MATLAB DFT questions Post by SoliS on Nov 21st, 2011, 8:45am here is a plot of some data after it's been "filtered" green is before the low pass filter, implemented with the equation y(n) = input(n)*(deltaT / (RC+deltaT)) + y(n-1) * (RC / (RC+deltaT)) where RC is the resistor/capacitor time constant, and deltaT is the spacing in my time vector. As you can see, as the first LPF is applied (blue line), the "slope" does not increase at all, but the high frequency peaks are attenuated. Why is the "noise floor" not attenuated? red line is a second filter applied; peaks are again attenuated but no visible difference in "noise floor" |
Title: Re: some MATLAB DFT questions Post by boe on Nov 22nd, 2011, 2:30am SoliS wrote on Nov 21st, 2011, 8:41am:
- B O E |
Title: Re: some MATLAB DFT questions Post by SoliS on Nov 22nd, 2011, 7:16am boe wrote on Nov 22nd, 2011, 2:30am:
thanks for this, I applied a windowing function and am getting results much closer to what I was expecting. Now I am just figuring out which window is optimal for the data I want to display. I originally thought I had an integer # of periods because of the way I defined my time vector (WRT the frequency of the sine wave) but after passing it through my system there is a delay introduced and a startup edge, causing it to differ from an integer # of periods ever so slightly (not visible on the plots). |
Title: Re: some MATLAB DFT questions Post by boe on Nov 22nd, 2011, 8:10am SoliS wrote on Nov 22nd, 2011, 7:16am:
- B O E |
Title: Re: some MATLAB DFT questions Post by SoliS on Nov 22nd, 2011, 8:20am boe wrote on Nov 22nd, 2011, 8:10am:
Maybe I am missing something, but... what about just increasing the length of the time vector and not cutting out the settling time? this would reduce its effects on the DFT. though I realize it is more unrealistic to leave it in there, as the DFT will show me what happens when I have a startup settling time every X periods of my waveform. I assumed this part of the waveform would be de-emphasized by the window in the first place. (it's only ~20 points of settling time out of a 100k point vector). Also, any recommendations for what type of window to use? I am trying to show the effects of low pass filtering on the image peaks of a sampled-and-held and reconstructed waveform. |
Title: Re: some MATLAB DFT questions Post by boe on Nov 23rd, 2011, 9:57am SoliS wrote on Nov 22nd, 2011, 8:20am:
NB: 20dB/decade roll-off is caused by a discontinuity in the periodically extended signal. Quote:
Quote:
Quote:
- B O E |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |