我正在尝试使用wavwrite导出plot(yi)中显示的数据。当我进行插值时,(yi)信号不会从零开始,我如何得到(yi)插值信号从零开始?请注意,由于wavwrite不能以这种方式工作,我不能只做一个情节(xxorig,yi)。有谁知道一项工作?
我正在使用octave 3.2.4 / matlab
clear all, clf
xxorig=[0, 0.418879, 0.837758, 1.25664, 1.67552, 2.0944, 2.51327, 2.93215, 3.35103, 3.76991, 4.18879, 4.60767, 5.02655, 5.44543, 5.86431, 6.28319];
xx=[0, 0.296192, 0.592384, 0.888577, 1.18477, 1.48096, 1.77715, 2.07335, 2.36954, 2.66573, 2.96192, 3.25811, 3.55431, 3.8505, 4.14669, 4.44288];
yy=[0, 0.406737, 0.743145, 0.951057, 0.994522, 0.866025, 0.587785, 0.207912, -0.207912, -0.587785, -0.866025, -0.994522, -0.951057, -0.743145, -0.406737, -2.44929e-16];
yi=interp1(xx,yy,xxorig);
subplot(4,1,1),plot(xxorig,yy),title("plot(xxorig,yy)")
subplot(4,1,2),plot(xx,yy),title("plot(xx,yy)")
subplot(4,1,3),plot(yy),title("plot(yy)")
subplot(4,1,4),plot(yi),title("plot(yi)")
wavwrite([yy'] ,16,32,'/tmp/test.wav')