Plotting sine wave using rad/samp
Mostrar comentarios más antiguos
If I need to plot a sine wave sampled at 8kHz for 4 seconds with a frequency of pi/10 rad/samples, would this be the right way to go about it?
Fs = 8000; % Sampling frequency
stopTime = 4; % Run time (seconds)
dr = pi/10; % Radians per sample
stopSample = Fs * stopTime; % Total samples
totalRad = (Fs * stopTime * dr); % Total radians for run time
r = 0:dr:totalRad; % Rad step for run time
% Generate sine wave
x = sin(r*dr);
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Digital Filter Analysis en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!