help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Interpolation/creating new length/time scale of signal/array


From: Rick T
Subject: Interpolation/creating new length/time scale of signal/array
Date: Tue, 20 Mar 2012 07:00:10 -1000

Hopefully this explains it a little better

I'm trying to export the data that is shown in plot(yi) using wavwrite.  When I do an interpolation the (yi) signal doesn't start at zero how can I get (yi) the interpolated signal to start at zero?  Please note that I can't just do a plot(xxorig, yi) due to the fact that wavwrite doesn't work this way.  Does anyone know a work around?

I'm using octave 3.2.4



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')



here's a pic of the graph
http://i43.tinypic.com/212id0g.png

--
--


reply via email to

[Prev in Thread] Current Thread [Next in Thread]