Expression for the Fourier Transform of a signal with finite support

1 view (last 30 days)
Hello! I want to determinate the expresion of Fourier Transformation for x[n] = e^(j*w0*n), n ∈ 0, N-1 , ( w - omega ) , w = pi/8. I just know that the Fourier Transformation sould look like this X(w), But i don't know how to do it
I tried this but it's not working as i wish
N = 10;
n = 0:0.01:N-1;
omega = -pi:0.01:pi;
j = sqrt(-1);
w = 0:0.01:pi;
n = 0:0.01:N-1;
x = exp (j*n*omega0);
X = x * exp(-j * n' * w);
  3 Comments
Walter Roberson
Walter Roberson on 28 Oct 2023
Should n be integer? The [] notation is used for discrete signal processing

Sign in to comment.

Answers (1)

Sudarsanan A K
Sudarsanan A K on 6 Nov 2023
Hello Nicolae,
I understand that you are trying to compute the Discrete-Time Fourier Transform (DTFT) of the signal , where rad and N is the total number of samples. I note that you are facing issue while computing the DTFT of the signal using the formula.
The formula for computing DTFT of a signal is:
This can be coded and compared with the result you are having as follows:
N = 32; % Number of points
n = 0:N-1;
w0 = pi/8;
j = sqrt(-1);
% Generate the time-domain signal
x = exp(j*w0*n);
% DTFT using the provided expression (The result you are having)
omega = -pi:0.01:pi;
X_expr = exp(-j * (omega - w0) * N/2) ./ exp(-j * (omega - w0)/2) .* sin((omega - w0) * N/2) ./ sin((omega - w0)/2);
% Compute the DTFT using the DTFT formula
X_dtft = zeros(size(omega));
for k = 1:N
X_dtft = X_dtft + exp(-j * omega * n(k)) * x(k);
end
% Plotting the time-domain signal
subplot(2,1,1);
stem(n, real(x), 'b', 'LineWidth', 1.5);
hold on;
stem(n, imag(x), 'r', 'LineWidth', 1.5);
hold off;
xlabel('n');
ylabel('x[n]');
title('Time-Domain Signal');
legend('Real Part', 'Imaginary Part');
grid on;
% Plotting the DTFT using the formula and expression
subplot(2,1,2);
plot(omega, abs(X_expr), 'g-', 'LineWidth', 2);
hold on;
plot(omega, abs(X_dtft), 'r--', 'LineWidth', 1.5);
hold off;
xlabel('Angular Frequency (\omega)');
ylabel('|X(\omega)|');
title('DTFT using Formula and Expression');
legend('Using Expression', 'Using Formula');
grid on;
If you are looking for the simplified expression for the DTFT of your input signal , you can consider the following code using the Symbolic Math Toolbox as follows:
syms n w w0 N;
% Define the sequence x[n]
x = exp(1i * w0 * n);
% Define the Fourier Transform X(w)
X = symsum(x * exp(-1i * w * n), n, 0, N-1);
% Simplify the expression
X = simplify(X);
% Display the result
X
X = 
The MathWorks documentations of the "symsum()" and "simplify()" functions can be found at:
Additionally, you can refer to the following blog that describes the relationship between DFT and DTFT where you can utilize the "fft()" function to compute DTFT:
I hope this clarifies your query.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!