A signal with multiple frequencies...

2.4k Views Asked by At

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

There are 1 best solutions below

0
On

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 );