What is the finite nature of MATLAB?

56 views (last 30 days)
Nghi
Nghi on 2 Apr 2024 at 11:32
Edited: Matt J on 2 Apr 2024 at 16:03
Hello all, I am plotting a sinc function, X= sinc (f) where f = -22050 to 22050, with a step of 0.1691, it can be seen in the plot below that this function has a very very densed plot:
However, when I zoomed in, it's still a plot of the sinc function, just very very densed due to the wide range and small step.
Then the next step is to inverse fourier transform this, which gave me the correct plot below in time domain as the pair is:
The quesion I received was observe the inaccuracies (if any) and give a reason why is it like that, the hint is to think about the finite nature of MATLAB. The overshoot of the time domain spectrum I can explain by Gibb's phenomenon. However, I don't understand what is in MATLAB that's called finite nature. Is this where when the range is too big and the step is too small (like the spectrum of sinc above) then MATLAB will just give us something out of limit that no one can fully see except zooming every single unit? Thank you for your time
  3 Comments
Nghi
Nghi on 2 Apr 2024 at 12:17
Well not exactly, some errors are there but the pattern and the major values are correct
Paul
Paul on 2 Apr 2024 at 13:51
Edited: Paul on 2 Apr 2024 at 15:43
The Gibbs phenomenon, if that's really what it is, shown above is in the frequency domain, not the time domain.

Sign in to comment.

Accepted Answer

Matt J
Matt J on 2 Apr 2024 at 11:45
Edited: Matt J on 2 Apr 2024 at 12:26
It is not the finite nature of Matlab, but rather the finite nature of an FFT. You are not transforming a true sinc function because a true sinc function extends to infinity, whereas the FFT works with some finite truncation of it. Also, the FFT does not consider the continuous values of the sinc, but rather a finite sampling of it.
  4 Comments
Matt J
Matt J on 2 Apr 2024 at 15:52
The DTFT of the discrete-time sinc is a rectangular pulse in the frequency domain, so sampling the continuous-time sinc shouldn't be an issue (as long as the sampling period is small enough)
Well, okay, but that is not true for arbitrary signals. The DTFT of a discrete-time rect pulse will never give you a precise sinc, for example, no matter the sampling period.
Matt J
Matt J on 2 Apr 2024 at 15:56
Edited: Matt J on 2 Apr 2024 at 16:03
Hello. Im understanding this as Matlab cannot transform an infinite array of time so it's against theory...
That's part of it, but I think the better way to see it as that the DFT (or its inverse) is not the same thing as a continuous Fourier Transform (or its inverse). It can approximate a continuous transform better as your sampling gets better, but the approximation can suffer when the sampling is either too coarse or too truncated in duration.

Sign in to comment.

More Answers (0)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Tags

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!