八度无法绘制频谱图

时间:2020-02-04 15:44:54

标签: plot octave

我正在使用八度中的代码来打印像这样的Spectogram。该代码来自实验室手册,但出现错误。 enter image description here

代码

[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

1 个答案:

答案 0 :(得分:0)

  1. 如警告所示,wavread已过时,应改为使用audioread
  2. specgram函数是signal包的一部分。要使用它,您应该首先加载信号包:pkg load signal。如果尚未安装,请先从八度伪造安装它:pkg install signal -forge
相关问题