필터 지우기
필터 지우기

how to create a vco with sine wave variation?

조회 수: 5 (최근 30일)
CAROL GARRITTY
CAROL GARRITTY 2017년 9월 18일
편집: CAROL GARRITTY 2017년 9월 19일
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