Holooly Plus Logo

Question 6.15: Using the DFT to approximate the CTFT Using the DFT, find th......

Using the DFT to approximate the CTFT

Using the DFT, find the approximate CTFT of

x(t) =\begin{Bmatrix} {t(1-t),} & {0<t<1} \\ {0,} & {otherwise} \end{Bmatrix} = t(1 − t) rect(t − 1/2)

numerically by sampling it 32 times over the time interval 0 ≤ t < 2.

The 'Blue Check Mark' means that either the MATLAB code/script/answer provided in the answer section has been tested by our team of experts; or the answer in general has be fact checked.

Learn more on how do we answer questions.

Script File

The following MATLAB program can be used to make this approximation.

% Program to demonstrate approximating the CTFT of t(1-t)*rect(t-1/2)
% by sampling it 32 times in the time interval 0 <= t < 2 seconds
% and using the DFT.
N = 32 ; % Sample 32 times
Ts = 2/N ; % Sample for two seconds
% and set sampling interval
fs = 1/Ts ; % Set sampling rate
df = fs/N ; % Set frequency-domain resolution
n = [0:N-1]’ ; % Vector of 32 time indices
t = Ts*n ; % Vector of times
x = t.*(1-t).*rect((t-1/2)); % Vector of 32 x(t) function values
X = Ts*fft(x) ; % Vector of 32 approx X(f) CTFT
% values
k = [0:N/2-1]’ ; % Vector of 16 frequency indices
% Graph the results
subplot(3,1,1) ;
p = plot(t,x,‘k’) ; set(p,‘LineWidth’,2) ; grid on ;
xlabel(‘Time, t (s)’) ; ylabel(‘x(t)’) ;
subplot(3,1,2) ;
p = plot(k*df,abs(X(1:N/2)),‘k’) ; set(p,‘LineWidth’,2) ; grid on;
xlabel(‘Frequency, f (Hz)’) ; ylabel(‘|X(f)|’) ;
subplot(3,1,3) ;
p = plot(k*df,angle(X(1:N/2)),‘k’) ; set(p,‘LineWidth’,2) ; grid on ;
xlabel(‘Frequency, f (Hz)’) ; ylabel(‘Phase of X(f)’) ;

This MATLAB program produces the graphs in Figure 6.32.
Notice that 32 samples are taken from the time-domain signal and the DFT returns a vector of 32 numbers. We only used the first 16 in these graphs. The DFT is periodic and the 32 points returned represent one period. Therefore the second 16 points are the same as the second 16 points occurring in the previous period and can be used to graph the DFT for negative frequencies. The MATLAB command fftshift is provided for just that purpose. Below is an example of using fftshift and graphing the approximate CTFT over equal negative and positive frequencies.

% Program to demonstrate approximating the CTFT of t(1-t)*rect(t-1/2)
% by sampling it 32 times in the time interval 0 < t < 2 seconds and
% using the DFT. The frequency domain graph covers equal negative
% and positive frequencies.
N = 32 ; % Sample 32 times
Ts = 2/N ; % Sample for two second
% and set sampling interval
fs = 1/Ts ; % Set sampling rate
df = fs/N ; % Set frequency-domain resolution
n = [0:N-1]’ ; % Vector of 32 time indices
t = Ts*n ; % Vector of times
x = t.*(1-t).*rect((t-1/2)) ; % Vector of 32 x(t) function values
X = fftshift(Ts*fft(x)) ; % Vector of 32 X(f) approx CTFT values
k = [-N/2:N/2-1]’ ; % Vector of 32 frequency indices
% Graph the results
subplot(3,1,1) ;
p = plot(t,x,‘k’) ; set(p,‘LineWidth’,2) ; grid on ;
xlabel(‘Time, t (s)’) ; ylabel(‘x(t)’) ;
subplot(3,1,2) ;
p = plot(k*df,abs(X),’k’) ; set(p,‘LineWidth’,2) ; grid on ;
xlabel(‘Frequency, f (Hz)’) ; ylabel(‘|X(f)|’) ;
subplot(3,1,3) ;

p = plot(k*dF,angle(X),‘k’) ; set(p,‘LineWidth’,2) ; grid on ;
xlabel(‘Frequency, f (Hz)’) ; ylabel(‘Phase of X(f)’) ;

Figures 6.33 and 6.34 show the results of this MATLAB program with 32 points and 512 points.
This result is a rough approximation to the CTFT because only 32 points were used. If we use 512 points over a time period of 16 seconds we get an approximation with higher frequencydomain resolution and over a wider frequency range.

التقاط
rr
aa

Related Answered Questions

Question: 6.9

Verified Answer:

This is the product of two functions. Therefore, u...
Question: 6.13

Verified Answer:

We can find the CTFT of the unit rectangle functio...
Question: 6.14

Verified Answer:

Method 1: Do the convolution first and find the CT...
Question: 6.11

Verified Answer:

Ordinarily we would try to directly integrate the ...