how to plot this equation ?
Show older comments
I'm trying to plot the equation shown in the image, but I'm not sure how to apply the Galois Seq. "gf()" here.
Can you please help me with this ?

Expected magnitude waveform.

clear all
close all
clc
%%
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 1024; % Length of signal
t = 2*(0:L-1)*T; % Time vector
signal = 0;
m = 5;
for k=1:((2^m)-1)
g = gf(2^m);
signal = signal + g(k).*exp(1i*2*pi*k*t)/((2^m)-1);
end
figure
subplot(2,2,1)
plot(t,signal)
title('signal')
Accepted Answer
More Answers (1)
Benjamin Thompson
on 26 Jan 2022
0 votes
This lines needs an extra set of parenthesis:
signal = signal + g(k).*exp((1i*2*pi*k*t)/((2^m)-1));
But the way you are using the gf function does not match how MATLAB describes it in the documentation.
Categories
Find more on Correlation and Convolution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!