Clear Filters
Clear Filters

how to use fourier in discrete

1 view (last 30 days)
ISMAEL BERMEJO CHULDE
ISMAEL BERMEJO CHULDE on 13 Feb 2022
Answered: Divit on 13 Sep 2023
HELLO, KNOW HOW CAN I REPRESENT FOURIER FOR DISCRETE SIGNALS?
syms z
disp('Primer sistema: z/(z - 1)')
Gz= z/(z-1);
r=roots([1 0 -1]) %polo igual a 1, el sist es marginalmente estable
Gjw=fft(Gz)
figure
subplot(1,2,1);
stem(abs(Gjw)) %grafica la parte real
xlabel('frec (Hz)')
ylabel('módulo')
subplot(1,2,2);
stem(imag(Gjw)) %grafica la parte imag
xlabel('frec (Hz)')
ylabel('argumento')

Answers (1)

Divit
Divit on 13 Sep 2023
Hi Ismael,
I understand that you would like to represent the Fourier transform of a discrete signal in MATLAB.
The code you provided seems to be attempting to compute and plot the Fourier transform of the discrete signal represented by the system “z/(z-1)”. However, there are a few issues in your code:
  • The system “Gz” is not defined as a discrete signal. It's defined as a rational function “z/(z-1)”. To compute the Fourier transform of a discrete signal, you need to have the discrete signal in a time-domain representation.
  • The “fft” function in MATLAB is used to compute the Discrete Fourier Transform (DFT) of a sequence of data points. It operates on discrete data, not symbolic expressions.
Here's an example of how you can represent the Fourier transform of a discrete signal in MATLAB:
% Define a discrete signal x[n]
n = 0:99; % Define the time indices (e.g., from 0 to 99)
x = sin(0.1*pi*n) + 0.5*sin(0.3*pi*n); % Example discrete signal
% Compute the Discrete Fourier Transform (DFT) of x[n]
X = fft(x);
% Create a frequency vector (in Hz) for plotting
fs = 1; % Sample rate (Hz)
f = (0:length(X)-1) * (fs / length(X));
% Plot the magnitude and phase of the Fourier transform
figure;
subplot(2, 1, 1);
stem(f, abs(X)); % Magnitude
xlabel('Frequency (Hz)');
ylabel('Magnitude');
subplot(2, 1, 2);
stem(f, angle(X)); % Phase
xlabel('Frequency (Hz)');
ylabel('Phase (radians)');
In this example, we define a discrete signal “x[n]” and then use “fft” to compute its DFT. We also create a frequency vector for plotting.
To know more you can refer to the following documentation links:
I hope this helps!

Community Treasure Hunt

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

Start Hunting!