A harmonic signal is basically the sum of a number of sinusoids, whose frequencies are multiples of a fundamental frequency.
Write a function named harmonic signal, which receives the
fundamental frequency, f0 (a real and positive number), the number
of harmonics, Nh (a positive integer number), harmonic
amplitudes, Ah (a vector of length Nh with elements greater than zero), the total duration of the harmonic signal, dur (a real and positive number), and the sampling rate, fs (a positive and integer number). The function should return a vector containing samples of the harmonic signal, X(t), over the speci?ed duration. The output vector should be normalized so that its maximum value is equal to one.
f0 = input('please enter the fundamental frequency which is a
real and positive number');
Nh = input('please enter the number of harmonics which is a positive integer');
Ah = zeros (Nh,1);
Ah(c,1)=input('Please enter the amplitude of the above
B = zeros (Nh,1)
dur = input('please enter the total duration of the harmonic signal which is real and positive number');
fs = input('please enter the sampling rate desired which is a positive integer');
Xt = zeros(dur*fs,1)
for r = 1:1:Nh
Xt(1, 1)= sum (B)
Xt(i*fs, 1)= sum (B)
Xt= Xt/norm (Xt, inf);
Get Answers For Free
Most questions answered within 1 hours.