how to add two sinusoid?

Status
Not open for further replies.

muaythai2006

Newbie level 6
Joined
Sep 3, 2005
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,392
I was asked to generate two sinusoids at the right freqnecies and add them samples by samples. The first frequencies of the first sinusoids is 1336 and other is 770.
 

1336 this is the highest frequency ...so u have to choose 2*1336 as the sampling frequency ...and sample both the sinusoids...then add them sample by sample
 

Code:
fs = your unspecified sample rate

for (n=0; n<1000; n++)
  output[n] = sin(2 * pi * 1336 * n / fs) + sin(2 * pi * 770 * n / fs);
Beep! You've just pressed "5".

I hope that wasn't your homework.
 

u could use signal synthesis
 

use function generator to generate them and add them using summer of gain 1
(op-amp)
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…