+ Post New Thread
Results 1 to 4 of 4

5th October 2012, 14:58 #1
 Join Date
 Oct 2012
 Posts
 2
 Helped
 0 / 0
 Points
 42
 Level
 1
please I need some help with this sinusoidal signal
I try to generate a sinusoidal signal in matlab which is :
Amplitude = 10
Frequency = 100
sample rate = 5000
singal duration T = 1 sec
initial phase = 0
But does not come with me . Can any one help me with the code?
Thanks

5th October 2012, 14:58

5th October 2012, 19:03 #2
Re: please I need some help with this sinusoidal signal
%program to generate sine wave
f= input('enter the frequency in hertz of the sine wave');
t=0:.0001:5;
y=sin(2*pi*f*t);
plot(t,y);
ylabel ('Amplitude');
xlabel ('Time Index');
TITLE ('Sine wave');
%with samples
t = [ 0 : 1 : 40 ]; % Time Samples
f = 500; % Input Signal Frequency
fs = 8000; % Sampling Frequency
x = sin(2*pi*f/fs*t); % Generate Sine Wave
figure(1);
stem(t,x,'r'); % View the samples
figure(2);
stem(t*1/fs*1000,x,'r'); % View the samples
hold on;
plot(t*1/fs*1000,x); % Plot Sine Wave
good luck
1 members found this post helpful.

5th October 2012, 19:03

7th October 2012, 06:49 #3
 Join Date
 Oct 2012
 Posts
 2
 Helped
 0 / 0
 Points
 42
 Level
 1
Re: please I need some help with this sinusoidal signal
thanks a lot for help
but what about if I have like thses tow what I need to write in matlap so this function can work :
1 Create a function using mat lab to generate a sinusoidal signal.
The parameters of the signal should have an Amplitude = 100
frequency = 100Hz
initial phase = 0
sample rate = 5000
signal duration (T) = 1 sec.
2 Add another sinusoid with frequency 1000 Hz and amplitude 100 to the one generated in 1. (All other parameters are the same). plot two cycles of the sum of the two signals in time.
thanks a lot

7th October 2012, 06:49

9th October 2012, 10:27 #4
 Join Date
 Apr 2011
 Location
 Bengaluru
 Posts
 25
 Helped
 2 / 2
 Points
 399
 Level
 4
Re: please I need some help with this sinusoidal signal
Please be specific regarding what is required, only then anyone can help you in generating the waveform. Also try out a few things yourself, we get to learn a lot when we try different things.
+ Post New Thread
Please login