Help with plotting sinusoidal wave
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, Im trying to plot a sinusoidal wave x(t) = 4cos(10*pi*t-pi/2) from -0.2 to 0.5 with 0.05 interval. The plot i get in matlab is a triangular wave and not a sinusoidal wave. am i missing any thing? :(
F = 5; A = 4; t = -0.2:0.05:0.5; phi = -pi/2; x = A*cos(2*pi*t*F + phi); plot(t,x) grid on
0 Kommentare
Antworten (1)
Rick Rosson
am 19 Mai 2012
Compare your sampling rate (in samples per second) to the frequency of your sine wave (in hertz or cycles per second). What is the ratio (both numerical value and units of measure) of the sampling rate to the sine wave's frequency? What does this information imply about the sampled sine wave and the triangle wave that you are seeing?
To see what is happening a bit more clearly, try using the stem function instead of plot.
stem(t,x);
HTH.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Matched Filter and Ambiguity Function finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!