I am trying to generates the variable Fourier series for a square wave signal and a uniformly distributed noise signal.
This is my code and I have this error
Undefined function 'symsum' for input arguments of type 'double'.
fs = 1000; %Sampling frequency Hz [1 1000]
l = 1 ; %Signal length sec [1 10]
% Fourier Series Parameter
h = 1; %Amplitude [0 10]; default 1
k =1 ; %Fourier Series lenght(k);[1 21]
% Noise Signal specific parameters
h1 = 1; %Amplitude (h); [0 10]; default: 1
%calculate signal
%x = 0:1/fs:L-1/fs;
x = 0:1/fs:l-1;
n = [1; Inf];
f(x) = 4*h/pi * symsum( (1./k) * sin((2*pi*k*x)),k,2*n-1,n); %Fourier series for a square wave signal
%uniformly distributed noise signaL
%Noise signal specific parameters
%Amplitude (h); [0 10]; default: 1
h2 = 1 ; % Noise Amplitude
sig_Noise = h2*(f(x) + sigma*randn(1,length(x))); % signal with phase & amplitude noise
plot(x,f(x))
my summation is here Summation how can I fix it?