Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我测量麦克风的脉冲响应。在情节开始时我有一些延迟,然后最高值出现在 40 毫秒并减少到 45 毫秒。当我进行傅立叶变换时,我只想使用 35-45 ms 之间的部分。当我使用不同的麦克风时,延迟会减少或增加,因此峰值会发生变化。所以,我想要的时间范围也会改变。如何在 MATLAB 中自动获得包含最高值的范围?
假设您有一个y测量向量并且想要一个长度2r+1测量间隔,您可以这样做:
y
2r+1
center = find(y==max(y)); % find the peak value y_edited = y(center-r:center+r); % look at r samples before and after this peak
然后对 进行傅里叶变换y_edited。请注意,信号中有噪音可能会影响您的性能。
y_edited