plot - 八度无法绘制频谱图
问题描述
我正在使用 octave 中的代码来打印这样的 Spectogram。代码来自实验室手册,但我遇到了错误。
编码
[x, Fs, bps] = wavread('digit.wav');
alpha=0.5; %Overlap
N=256;% 32ms window size
figure(2)
clf()
specgram(x,N,Fs,hanning(N),alpha*N);
xlabel('Time (s)', "fontsize", 18)
ylabel('Frequency (Hz)', "fontsize", 18)
错误
>> spectogram
warning: wavread is obsolete and will be removed from a future version of Octave,please use audioread instead
warning: called from
wavread at line 62 column 5
spectogram at line 1 column 11
error: 'specgram' undefined near line 7 column 1
error: called from
spectogram at line 7 column 1
解决方案
- 正如警告所暗示的,
wavread
已过时,您应该audioread
改用 - 该
specgram
函数是signal
包的一部分。要使用它,您应该首先加载信号包:pkg load signal
. 如果您还没有安装它,请先从 octave forge 安装它:pkg install signal -forge
.
推荐阅读
- cryptocurrency - 使用 Nodejs 创建 Tron 钱包
- c++ - 根据成员存在创建不同的模板版本
- python - 如何在 django 中进行 2 路访问验证?
- javascript - 有没有办法直接设置在 JavaScript 中生成的文本内容的样式?
- ruby-on-rails - 无法更新 Rails。错误消息“找不到带有 'id'=:id 的电影”
- python - 排序数组 - 最少步骤
- java - ManyToOne 双选休眠
- spring-mvc - Spring 5 MVC Test with MockMvc, test-context.xml, and annotation-based WebAppConfig (ie, in Java)
- java - Spring Cloud @StreamListener 条件已弃用什么是替代方案
- python - 如何为弹性 beanstalk python web 应用程序配置替代文件名