Вы находитесь на странице: 1из 4

Experiment-2

AIM : To verify the following properties of the discrete Fourier transform 1. Convolution Property 2. Time Shifting Property 3. Frequency Shifting Property
1. Convolution Property i. Construct two rectangular pulses. ii. Multiply the N point DFT of these pulses. iii. Compute the IDFT. iv. For Verification convolve the two original pulses and compare with the waveform obtained after computing IDFT. Theory: In mathematics, the discrete Fourier transform (DFT) is a specific kind of discrete transform, used in Fourier analysis. It transforms one function into another, which is called the frequency domain representation, or simply the DFT, of the original function (which is often a function in the time domain). But the DFT requires an input function that is discrete and whose non-zero values have a limited (finite) duration. Such inputs are often created by sampling a continuous function, like a person's voice. The input to the DFT is a finite sequence of real or complex numbers (with more abstract generalizations discussed below), making the DFT ideal for processing information stored in computers. In particular, the DFT is widely employed in signal processing and related fields to analyze the frequencies contained in a sampled signal, to solve partial differential equations, and to perform other operations such as convolutions or multiplying large integers. A key enabling factor for these applications is the fact that the DFT can be computed efficiently in practice using a fast Fourier transform (FFT) algorithm. Discrete Fourier transforms are extremely useful because they reveal periodicities in input data as well as the relative strengths of any periodic components. Difference between Discrete Fourier Transform (DFT) and Discrete-time Fourier Transform (DTFT) The DFT only evaluates enough frequency components to reconstruct the finite segment that was analyzed. The inverse DFT cannot reproduce the entire time domain, unless the input happens to be periodic (forever). The DTFT frequency-domain representation is always a periodic function. The inverse transform regenerates the entire discrete time sequence. The convolution of and g is written *g, using an asterisk or star. It is defined as the integral of the product of the two functions after one is reversed and shifted. As such, it is a particular kind of integral transform:

While the symbol t is used above, it need not represent the time domain. But in that context, the convolution formula can be described as a weighted average of the function () at the moment t where the weighting is given by g() simply shifted by amount t. As t changes, the weighting function emphasizes different parts of the input function.

More generally, if f and g are complex-valued functions on Rd, then their convolution may be defined as the integral:

Code:
%To analyze the convolution property j=5;l=4;n=20;k=2;m=3; %defining two rectangular pulses x1=[zeros(1,j) ones(1,n-j-k) zeros(1,k)]; x2=[zeros(1,l) ones(1,n-l-m) zeros(1,m)]; %computing the fourier transforms p point fft, p=300 dft1=fft(x1,300); dft2=fft(x2,300); %sample by sample product of two fft's dfty=dft1.*dft2; y=ifft(dfty); %convolution of original signals y1=conv(x1,x2); subplot(2,1,1);stem(y); AXIS([0 50 0 20]); xlabel('samples');ylabel('idft of dft1.*dft2'); title('Product of DFTs of two Square Pulses'); subplot(2,1,2);stem(y1); AXIS([0 50 0 20]); xlabel('sample');ylabel('convolution 0f x1 and x2'); title('Result of Convolution of two Pulses);

Output:

2. Time Shifting Property i. Construct one rectangular pulse x[n] of length N. ii. Let M point DFT of pulse x[n] be y[n] with M = 2^R>=N. iii. Multiply y[n] by an expression exp {K*j(2/M)*n}. iv. Compute M point IDFT of function and verify that the waveform has shifted by K

Theory: Time Shifting :

Proof: If we let , we get

Code:
%To verify the time-shifting property %defining the rectangular pulse x1=[zeros(1,10) ones(1,10) zeros(1,10)]; G=7;P=30; %P=length of rectangular pulse dft1=fft(x1,30); %M point fft for n=1:1:30 DFTY2(n)=dft1(n).*exp(G*1i*(2*pi/P)*n); y1=ifft(DFTY2); end subplot(2,1,1);stem(x1); xlabel('sample');ylabel('x1'); title(' Original rectangular pulse') subplot(2,1,2);stem(abs(y1)); xlabel('samples');ylabel('idft y1'); title('The Resulting Shifted Signal by G=7 points');

Output :

C. Frequency Shifting Property i. Construct one rectangular pulse x[n] of length N. ii. Let M point DFT of pulse x[n] be y[n] with M = 2^R>=N. iii. Multiply x[n] by an expression exp {K*j(2/M)*n}. iv. Compute M point DFT of function and verify that the spectrum has shifted by (2/M).K on an axis from 0 to 2. Theory: Frequency Shifting :

Code : %To verify the frequency-shifting property


%defining the rectangular pulse x1=[zeros(1,10) ones(1,10) zeros(1,10)]; H=7;P=30; %P=N=30=length of rectangular pulse dftx1=fftshift(fft(x1,30)); %M point fft for n=1:1:30 x3(n)=x1(n).*exp(H*1i*(2*pi/P)*n); dftx3=fftshift(fft(x3,30)); %M point fft end m=2*(pi/30)*[0:1:29]; subplot(3,1,1);stem(x1); xlabel('samples');ylabel('x1'); title('Original rectangular pulse'); subplot(3,1,2);stem(m,abs(dftx1)); set(gca,'XTick',0:pi/2:2*pi); set(gca,'XTickLabel',{'0','0.5*pi','pi','1.5*pi','2*pi'}); xlabel('samples');ylabel('DFT of X1[n]'); title('Fourier transform of original pulse X1[n]'); subplot(3,1,3);stem(m,abs(dftx3)); set(gca,'XTick',0:pi/2:2*pi); set(gca,'XTickLabel',{'0','0.5*pi','pi','1.5*pi','2*pi'}); xlabel('samples');ylabel('dft of X3[n]'); title('The DFT (of x3[n])is shifted spectrum of X1[n] by 2*pi*H/P=1.46=0.46*pi, P=N=30, H=7');

Output :

Вам также может понравиться