Continue to Site

# Matlab Stem Functions

Status
Not open for further replies.

#### electronicstudent

##### Newbie level 2
Hi all, I have never done a lot with Matlab but have an assignment to do the requires me to use stem functions to investigate natural sampling of a single base band frequency. I have got the sampling frequency done using the stem functions but am not sure how to go about combing the two. The info signal is a 10 KHz sine wave and the sampling frequency is 50 KHz. The result should be a sinc function with the spectral lines shifted by 10KHz, can any one tell me how i do this in Matlab, and if so can you please dumb it down as Im almost unfamiliar with Matlab.

#### xpress_embedo

Code:
fSampling = 50000;   % 50Khz Sampling Frequency
fSignal = 10000;
t = 0:1/fSampling:1;
xSignal = sin(2*pi*fSignal*t);
plot(t(1:50),xSignal(1:50))
stem(t(1:50),xSignal(1:50))

Simple Use of Stem and Plot Function

Plot Function Plot

Stem Function Plot

Sampling Frequency > 2*Signal Frequency

#### electronicstudent

##### Newbie level 2
Hi there, ty for your reply. I have to be able to view that sine wave in the frequency domain and use stem functions to do this. I then have to do the same for the sampling frequency. I then have to convolve these two stem functions together for a result. I understand these from a theory point of view but am unable to do so using matlab.

~Conor

#### xpress_embedo

Hi there, ty for your reply. I have to be able to view that sine wave in the frequency domain and use stem functions to do this. I then have to do the same for the sampling frequency. I then have to convolve these two stem functions together for a result. I understand these from a theory point of view but am unable to do so using matlab.

~Conor

Sorry I didn't get what you want to do...

If u are able to explain me properly then i can help u

Status
Not open for further replies.