Why does the 21 Point DFT in MATLAB produce so many zero values?

  • Thread starter Thread starter impervious
  • Start date Start date
  • Tags Tags
    Dft Matlab Point
Click For Summary

Discussion Overview

The discussion revolves around the behavior of the 21-point Discrete Fourier Transform (DFT) in MATLAB, specifically addressing why many of the resulting values are zero. Participants explore the implications of using a boxcar function and its effects on the DFT output, including the appearance of sinc functions in the context of signal processing.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant notes that the DFT output contains many zero values and seeks an explanation related to the properties of the sinc function.
  • Another participant suggests that the boxcar function used is not centered, which may introduce a complex phase and affect the DFT results.
  • A different participant expresses concern about the significance of the zero values occurring at sampling integers of 3, indicating a potential misunderstanding of the underlying principles.
  • There is a clarification that the initial plot of the DFT output is of its absolute value, which may not represent the expected sinc function shape.
  • Discussion includes observations about the phase plot, noting that every third element has a phase of approximately ±π, which could be related to the boxcar function's centering in the time domain.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the cause of the zero values in the DFT output, with multiple competing views and interpretations presented regarding the boxcar function and its effects.

Contextual Notes

There are limitations regarding the assumptions made about the boxcar function's properties and its centering, as well as the interpretation of the DFT output plots. The discussion does not resolve these aspects.

Who May Find This Useful

Individuals interested in signal processing, MATLAB programming, and the mathematical properties of Fourier transforms may find this discussion relevant.

impervious
Messages
2
Reaction score
0
Hello, I was trawling through some MATLAB work, and came across a question that bugged me, and I hope that someone might be able to give a suitable explanation.

The question was explain why the 21 point DFT has so many values equal to zero. Both DFT's are sinc functions where:

sinc(L)= sin(L * theta)/sin(L)

Heres my MATLAB code :

>> nn=0:20;
>> x=zeros(21,1);
>> x(1:7)=boxcar(7);
>> X=fft(x);
>> subplot(2,2,1),stem(nn,x);
>> subplot(2,2,2),stem(nn,abs(X));
>> subplot(2,2,3),stem(nn,angle(X));

The output of this is attached.

I understand that the basic sinc function is widely used in signals due to its zero crossings, however neither the input of the output look much like sinc functions I have seen before.

Any suggestions much appreciated.
 

Attachments

  • fft.jpg
    fft.jpg
    13.6 KB · Views: 610
Physics news on Phys.org
Your boxcar isn't centered, so it's introducing a complex phase. Try setting x to {1,1,1,1,0,...,0,1,1,1}. You'll then find the imaginary parts of X are essentially 0. Plot the real part of X, and it'll look like a sinc function.
 
Unfortunately I think I am using the boxcar they want me to use, and are talking in relation to the six zero points in my DFT.
Since they occur at sampling integers of 3, I can't help but feel this is somehow an important point that I don't understand.
 
Your first plot of X isn't of the plain sinc function; it's a plot of its absolute value. Can you see why your plot looks the way it does now?

On the phase plot, you might notice that the phase of every third element is essentially ±π. If you ignore those, you can see the remaining phases follow a nice pattern. That pattern arises because your boxcar isn't centered in the time domain.
 

Similar threads

Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
6K
Replies
1
Views
6K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 15 ·
Replies
15
Views
7K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 175 ·
6
Replies
175
Views
28K
Replies
18
Views
2K