0
votes

Consider the following script that plots a sine wave.

t = 0:pi/100:2*pi;
y = sin(t);
plot(t,y)
grid on % Turn on grid lines for this plot

This gives me a plot of sine wave. I understand the sine wave that appears continuous, should actually be discrete (my PC cannot store infinite no. of samples of continuous signal), and the matlab plot function does some kind of interpolation to connect the dots. So In fact I also used stem instead of plot to see the sampled values (on time axis) of sine.

Now my question is there must be some sampling frequency used here. How much is that?

1

1 Answers

2
votes

The sampling interval is the time interval between two consecutive samples of your signal.

The sampling frequency means how much samples of your signal you have in a fixed time interval, and it is reciprocal to the sampling interval.

You declared:

t = 0:pi/100:2*pi;

So your sampling interval is π/100. This means that your sampling frequency is 100/π.

If you want exact units, you'll have to determine the time units for t. If t is in seconds, then your sampling frequency is 100/π Hz (1Hz = 1sec-1).

By the way, MATLAB's plot connects the sampling with straight lines, there is no additional interpolation involved.