1

I'm doing an assignment on Fourier series in MATLAB.

The first part states:

Generate a signal with frequencies $50$Hz, $150$Hz and $300$Hz.

I can easily generate a signal with one frequency, but how do I generate one signal with all frequencies ?

Maybe I'm misinterpreting this.

1 Answers1

2

You're overthinking it. Just add them together:

fs = 700;
t = (0 : 1/fs : 1)';
f = [ 50, 150, 300 ];
x = sum( cos(2*pi * t * f), 2 );