Plotting the tone frequencies
조회 수: 4 (최근 30일)
이전 댓글 표시
I am in the process of creating sound. I've created the tone frequencies, but I'll need to show it on a diagram (ex. plot), but it keep giving me error, when using the:
plot(s1+s2);
What am I doing wrong?
The two first plots doesn't give any results, it's just blue.
figure
subplot(3,1,1);
plot(t, s1);
xlim([0 1E+3]);
grid
subplot(3,1,2);
plot(t, s2);
xlim([0 1E+3]);
grid
subplot(3,1,3);
plot(t, s1 + s2);
xlim([0 1E+3]);
grid
댓글 수: 2
Cris LaPierre
2020년 10월 4일
It's always helpful to share the full error message as well.
When I run the code you shared with the plot command at the end, it generates a warning, but the plot appears. Is that what you see?
채택된 답변
Star Strider
2020년 10월 4일
Note that ‘t’ seems to be missing.
Substituting for it and changing the xlim parameters:
t = values;
figure
subplot(3,1,1);
plot(t, s1);
xlim([0 1E-1]);
grid
subplot(3,1,2);
plot(t, s2);
xlim([0 1E-1]);
grid
subplot(3,1,3);
plot(t, s1 + s2);
xlim([0 1E-1]);
grid
appears to create two separate tones and a modulated summation.
It is necessary to ‘zoom’ the plots this way in order to see the details.
댓글 수: 13
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!