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:
x = sin(0.1*pi*n) + 0.5*sin(0.3*pi*n);
f = (0:length(X)-1) * (fs / length(X));
xlabel('Frequency (Hz)');
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!