how to create a vco with sine wave variation?

4 次查看(过去 30 天)
I was able to create a moving phase animation of a vco using spectrogram. Sort of like a strip chart? But I would like to create a sine wave variation instead of a sawtooth. Code snippet below. Figure 1 is a static display of a sawtooth variation. Figure 2 is a moving phase display based on Figure 1. Figure 3 is my workspace for a sine wave variation.
figure(1)
fs = 10e3;
t = 0:1/fs:2;
x = vco(sawtooth(7*pi*t,0.5),[0.1 0.4]*fs,fs);
spectrogram(x,kaiser(256,5),220,512,fs,'yaxis')
figure(2)
fs = 10e3;
for phase = 0:1:10;
t = 0:1/fs:2;
y = vco(sawtooth(7*pi*t+phase,0.5),[0.1 0.4]*fs,fs);
spectrogram(y,kaiser(256,5),220,512,fs,'yaxis');
disp(phase);
pause(0.1);
end
figure(3)
fs = 10e3;
for phase = 0:1:10;
for freq = 1:1:10
t = 0:1/fs:2;
z = sin(freq*1000*t+phase);
spectrogram(z,kaiser(256,5),220,512,fs,'yaxis');
disp(phase);
pause(0.1);
end
end

回答(1 个)

CAROL GARRITTY
CAROL GARRITTY 2017-9-19
编辑:CAROL GARRITTY 2017-9-19
I think I figured it out. I thought I tried this before, but I must have misspelled something.
figure(3)
fs = 10e3;
for phase = 0:1:10;
t = 0:1/fs:2;
z = vco(sin(5*pi*t+phase),[0.1 0.4]*fs,fs);
spectrogram(z,kaiser(256,5),220,512,fs,'yaxis');
disp(phase);
pause(0.1);
end

类别

Help CenterFile Exchange 中查找有关 Just for fun 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by