[英]Matlab chirp duration is longer than it should be
I am learning Matlab and now using the function chirp.我正在学习 Matlab,现在正在使用 function chirp。
freq = 1/11025; duration = 1.5; c = 0:freq:duration;
y = chirp(c,0,150,duration)
The problem is, that it doesn't stop at 1.5.问题是,它不会停在 1.5。 Instead it stops at 1.65.相反,它止于 1.65。 But I don't know why.但我不知道为什么。
Your interpretation of the chirp() function is not correct.您对 chirp() function 的解释不正确。 Here is how you can create a fully customizable chirp function via the dsp.Chirp:以下是如何通过 dsp.Chirp 创建完全可定制的 chirp function:
hChirp = dsp.Chirp(...
'TargetFrequency', 10, ...
'InitialFrequency', 0,...
'TargetTime', 10, ...
'SweepTime', 10, ...
'SamplesPerFrame', 10000, ...
'SampleRate', 1000);
plot(hChirp()); set(gcf, 'color', 'w'), grid on;
title('Chirp to 10 Hz')
Which gives the following output in this example:在此示例中给出以下 output:
You can refer to the documentation for further detail.您可以参考文档以获取更多详细信息。 This should be a more rigorous way of defining your signal.这应该是一种更严格的信号定义方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.