1 / 45

DCSP-12

DCSP-12. Jianfeng Feng Jianfeng.feng@warwick.ac.uk http://www.dcs.warwick.ac.uk/~feng/dsp.html. For example, if a sequence is a sinusoid x(n)=cos( w 0 n) of infinite length, its DTFT yields two `delta' functions, X( w )= p d ( w - w 0 )+ p d ( w + w 0 )

zelig
Download Presentation

DCSP-12

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DCSP-12 Jianfeng Feng Jianfeng.feng@warwick.ac.uk http://www.dcs.warwick.ac.uk/~feng/dsp.html

  2. For example, if a sequence is a sinusoid x(n)=cos(w0 n) of infinite length, its DTFT yields two `delta' functions, X(w)= p d (w - w0)+ p d (w +w0) as in Fig. below where we assume all frequencies w and w0 to be within the intervals [- p , p ). Here d (x) is the Dirac delta function (not confused with the unit impulse defined before)

  3. This shows that the DTFT gives perfect frequency localization as an exact concentration of energy at - w0 andw0 provided

  4. This shows that the DTFT gives perfect frequency localization as an exact concentration of energy at - w0 andw0 provided (a) the sequence lasts from -infinity to infinity and we have an infinite amount of memory to actually collect all the data points, and

  5. This shows that the DTFT gives perfect frequency localization as an exact concentration of energy at - w0 andw0 provided (a) the sequence lasts from -infinity to infinity and we have an infinite amount of memory to actually collect all the data points, and (b) we compute X( w ) for all possible frequencies w in the interval [- p, p ), again requiring an infinite amount of memory and an infinite computational time.

  6. In practice, we do not have infinite memory, we do not have infinite time, and also any signal we want to analyze does not have infinite duration.

  7. In practice, we do not have infinite memory, we do not have infinite time, and also any signal we want to analyze does not have infinite duration. In addition, the spectrum of the signal changes with time, just as music is composed of different notes that change with time.

  8. In practice, we do not have infinite memory, we do not have infinite time, and also any signal we want to analyze does not have infinite duration. In addition, the spectrum of the signal changes with time, just as music is composed of different notes that change with time. Consequently, the DTFT generally is not computable unless we have an analytical expression for the signal we analyze, in which case we can compute it symbolically.

  9. But most of the time this is not the case, especially when we want to determine the frequency spectrum of a signal measured from an experiment.

  10. But most of the time this is not the case, especially when we want to determine the frequency spectrum of a signal measured from an experiment. In this situation, we do not have an analytical expression for the signal, and we need to develop an algorithm that can be computed numerically in a finite number of steps, such as the discrete Fourier transform (DFT).

  11. DFT

  12. clear all • close all • N=10; %sampling rate N Hz • T=20; % time • d1=1; % first period • d2=0 % second period • for i=1:T*N • t(i)=i/N; • x(i)=cos(d1*2*pi*i/N)+cos(d2*2*pi*i/N); • end • figure(1) • plot(t,x) • figure(2) • plot(t*N/(T),abs(fft(x))) • xlim([0 N/2]); • xlabel('Hz')

  13. clear all • close all • sampling_rate=100;%Hz • omega=20; %signal frequecy Hz • N=10000; %total number of samples • for i=1:N • x_sound(i)=cos(2*pi*omega*i/sampling_rate); %signal • x(i)=cos(2*pi*omega*i/sampling_rate)+2*randn(1,1); %signal+noise • axis(i)=sampling_rate*i/N; % for psd • time(i)=i/sampling_rate; % for time trace • end • subplot(1,2,1) • plot(time,x); %signal + noise, time trace • subplot(1,2,2) • plot(axis,abs(fft(x)),'r'); % magnitude of signal • sound(x_sound); %true signal sound

  14. The relationship between DFT and DTFT w = 2 p k /N

  15. In spite of their similarities, the DFT and DTFT are two quite different operations. Whereas the DFT is a numerical operation, which computers a finite number of coefficients X(0), … ,X(N-1) from a finite set of data x(0), … ,x(N-1),

  16. the DTFT is not computable numerically because it yields a continuous function, X(w), based on an infinite sequence x(n). In this section we address the problem of estimating X(w)=DTFT{x(n)} based on the DFT of a sample of finite length N.

  17. Now the question is, will XN converges to X as N tends to infinity for each value of the frequency variable w ?. If the answer is positive, the approximation makes sense and we can say that we can estimate the frequency spectrum of the whole signal based on a set of samples. The more data(i.e. the larger N is), the better the approximation.

  18. The answer Three cases • absolutely summable • finite energy • general case

  19. Absolutely summable signals. These signals are such that S |x(n)| < infinity For these signals the DTFT always exists, is finite, and converges for every w as

  20. These are the best-behaved sequences, in terms of convergence. This means that for every w, we can approximated X ( w ) infinitely closely by the finite sequence XN ( w ), with N sufficiently large. Typical examples in this class are signals decaying as 1/n2 for which |x(n)| < C/ n2, for n sufficiently large. In particular, signals decaying exponentially fast.

  21. Gibbs phenomena: cause a lot troubles in practice applications

  22. Third case: Example: cos (omega_0 n)

  23. DFT for spectral estimation One of the uses of the DFT is to estimate the frequency spectrum of a signal. The Fourier transform of a function produces a spectrum from which the original function can be reconstructed by an inverse transform. So it is reversible. (signal processing: transforms, demo)

  24. In order to do that, it preserves not only the magnitude of each frequency component, but also its phase. This information can be represented as a 2-dimensional vector or a complex number, or as magnitude and phase (polar coordinates). In graphical representations, often only the magnitude (or squared magnitude) component is shown. This is also referred to as a power spectrum .

  25. In particular, given a continuous time signal x(t), the goal is to determine its frequency components by taking a finite set of samples as a vector, (x(0), x(1),…, x(N-1)), and computing its DFT as in the previous section.

  26. The fact that we window the signal x(n) (i.e. we take a finite set of data) will have an effect on the frequency spectrum we compute, and we have to be aware of that when we interpret the results of the DFT. This can be seen by defining a window sequence

  27. and the DTFT of the windowed signal Now notice that we can relate the right-hand side of the preceding expression to the DFT of the finite sequence x(0), … ,x(N-1)

  28. To see the effect of the windowing operation on the frequency spectrum, let us examine the case when the signal x(n) is a complex exponential, such as x(n) = exp( j w0 n)

  29. N=10, w0= 0.5

  30. Two effects of DFT • Lose of resolution • Leakage of energy from mainlobe to sidelobes

  31. As we have seen, the DFT is the basis of a number of applications, and is one of the most important tools in digital signal processing. The problem with this algorithm is that a brute-force implementation would hardly be feasible in real time, even for a data set of modest length.

  32. Fortunately, the DFT can be computed in a very efficient way, exploiting the very structure of the algorithm we have presented by using the fast Fourier transform (FFT), which is an efficient way of computing he DFT. It is know that for a data set of length N, the complexity of the FFT grows as N log N, the complexity of the DFT computed by brute force grow as N2. FFT is widely used in many applications.

  33. Spectrogram • A spectrogram is an image that shows how the power spectrum of a signal varies with time.

  34. Frequency Time

  35. Sampling and reconstruction The question we consider here is under what conditions we can completely reconstruct the original signal x(t) from its discretely sampled signal x(n).

More Related