Discrete Time Periodic SignalsA discrete time signal x[n] is periodic with period N if and only iffor all n .Definition:Meaning: a periodic signal keeps repeating itself forever!
Example: a SinusoidConsider the Sinusoid:It is periodic with period since for all n.
General Periodic SinusoidConsider a Sinusoid of the form:It is periodic with period N since for all n.with k, N integers.
Consider the sinusoid:It is periodic with period since for all n.We can write it as:Example of Periodic Sinusoid
Consider a Complex Exponential of the form:for all n.It is periodic with period N sincePeriodic Complex Exponentials
Consider the Complex Exponential:We can write it asExample of a Periodic Complex Exponentialand it is periodic with period N = 20.
Goal:We want to write all discrete time periodic signals in terms of a common set of reference signals.Reference FramesIt is like the problem of representing a vector in a reference frame defined by an origin 0 reference vectors
Reference Frames in the Plane and in SpaceFor example in the plane we need two reference vectorsReference Frame while in space we need three reference vectorsReference Frame
A Reference Frame in the PlaneIf the reference vectors have unit length and they are perpendicular (orthogonal) to each other, then it is very simple:Where projection of along projection of alongThe plane is a 2 dimensional space.
A Reference Frame in the SpaceIf the reference vectors have unit length and they are perpendicular (orthogonal) to each other, then it is very simple:Where projection of along projection of along projection of alongThe space is a 3 dimensional space.
Example: where am I ?Point x is 300m East and 200m North of point 0.
Reference Frames for SignalsWe want to expand a generic signal into the sum of reference signals.The reference signals can be, for example, sinusoids or complex exponentials
Back to Periodic SignalsA periodic signal x[n] with period N can be expanded in terms of N complex exponentialsas
A Simple ExampleTake the periodic signal x[n] shown below:Notice that it is periodic with period N=2.Then the reference signals areWe can easily verify that (try to believe!):for all n.
Another Simple ExampleTake another periodic signal x[n] with the same period (N=2):Then the reference signals are the sameWe can easily verify that (again try to believe!):for all n.Same reference signals, just different coefficients
Orthogonal Reference SignalsNotice that, given any N, the reference signals are all orthogonal to each other, in the senseSinceby the geometric sum
apply it to the signal representation and we can compute the coefficients. Call then
Discrete Fourier Series Given a periodic signal x[n] with period N we define the Discrete Fourier Series (DFS) asSince x[n] is periodic, we can sum over any period. The general definition of Discrete Fourier Series (DFS) isfor any
Inverse Discrete Fourier Series The inverse operation is called Inverse Discrete Fourier Series (IDFS), defined as
Revisit the Simple ExampleRecall the periodic signal x[n] shown below, with period N=2:ThenTherefore we can write the sequence as
Example of Discrete Fourier Series Consider this periodic signalThe period is N=10. We compute the Discrete Fourier Series
now plot the values
Example of DFSCompute the DFS of the periodic signalCompute a few values of the sequenceand we see the period is N=2. Thenwhich yields
Signals of Finite LengthAll signals we collect in experiments have finite lengthExample: we have 30ms of data sampled at 20kHz (ie 20,000 samples/sec). Then we have
Series Expansion of Finite DataWe want to determine a series expansion of a data set of length N.Very easy: just look at the data as one period of a periodic sequence with period N and use the DFS:
Discrete Fourier Transform (DFT)Given a finite interval of a data set of length N, we define the Discrete Fourier Transform (DFT) with the same expression as the Discrete Fourier Series (DFS):And its inverse
Signals of Finite LengthAll signals we collect in experiments have finite length in timeExample: we have 30ms of data sampled at 20kHz (ie 20,000 samples/sec). Then we have
Series Expansion of Finite DataWe want to determine a series expansion of a data set of length N.Very easy: just look at the data as one period of a periodic sequence with period N and use the DFS:
Discrete Fourier Transform (DFT)Given a finite of a data set of length N we define the Discrete Fourier Transform (DFT) with the same expression as the Discrete Fourier Series (DFS):and its inverse
Example of Discrete Fourier Transform Consider this signalThe length is N=10. We compute the Discrete Fourier Transform
now plot the values
DFT of a Complex ExponentialConsider a complex exponential of frequency rad. We take a finite data length and its DFTHow does it look like?
Recall Magnitude, Frequency and Phase2. We represented it in terms of magnitude and phase:magnitudephaseRecall the following:1. We assume the frequency to be in the interval
Compute the DFTNotice that it has a general form:where (use the geometric series)
See its general form:
since:
and plot the magnitude
ExampleConsider the sequenceIn this case Then its DFT becomesLets plot its magnitude:
... first plot this
and then see the plot of its DFTThe max corresponds to frequency
Same Example in MatlabGenerate the data:>> n=0:31;>>x=exp(j*0.3*pi*n);Compute the DFT (use the Fast Fourier Transform, FFT):>> X=fft(x);Plot its magnitude:>> plot(abs(X)) and obtain the plot we saw in the previous slide.
Same Example in MatlabGenerate the data:>> n=0:31;>>x=exp(j*0.3*pi*n);Compute the DFT (use the Fast Fourier Transform, FFT):>> X=fft(x);Plot its magnitude:>> plot(abs(X)) and obtain the plot we saw in the previous slide.
Same Example (more data points)Consider the sequenceIn this case >> n=0:255;>>x=exp(j*0.3*pi*n);>> X=fft(x);>> plot(abs(X))See the plot
and its magnitude plot
What does it mean?The max corresponds to frequency A peak at index means that you have a frequency
ExampleYou take the FFT of a signal and you get this magnitude:There are two peaks corresponding to two frequencies:
DFT of a SinusoidConsider a sinusoid with frequency rad. We take a finite data length and its DFTHow does it look like?
Sinusoid = sum of two exponentialsRecall that a sinusoid is the sum of two complex exponentials
Use of positive frequenciesThen the DFT of a sinusoid has two components but we have seen that the frequencies we compute are positive. Therefore we replace the last exponential as follows:
Represent a sinusoid with positive freq.Then the DFT of a sinusoid has two components
ExampleConsider the sequenceIn this case Then its DFT becomesLets plot its magnitude:
... first plot this
and then see the plot of its DFTThe first max corresponds to frequency
SymmetryIf the signal is real, then its DFT has a symmetry: In other words:Then the second half of the spectrum is redundant (it does not contain new information)
Back to the Example:If the signal is real we just need the first half of the spectrum, since the second half is redundant.
Plot half the spectrumIf the signal is real we just need the first half of the spectrum, since the second half is redundant.
Same Example in MatlabGenerate the data:>> n=0:31;>>x=cos(0.3*pi*n);Compute the DFT (use the Fast Fourier Transform, FFT):>> X=fft(x);Plot its magnitude:>> plot(abs(X)) and obtain the plot we saw in the previous slide.
Same Example (more data points)Consider the sequenceIn this case >> n=0:255;>>x=cos(0.3*pi*n);>> X=fft(x);>> plot(abs(X))See the plot
and its magnitude plotThe first max corresponds to frequency
ExampleYou take the FFT of a signal and you get this magnitude:There are two peaks corresponding to two frequencies:
************************************************************