trying to give audio input signal to ode but getting inaccurate results
1 次查看(过去 30 天)
显示 更早的评论
I am giving external input signal to adaptive hopf oscillator and i want to adapt audio input signal frequency. I have done it using ode45 but the sumulation taking too much time and not getting accurate result.
here i am giving fi2 as an input but i am not getting accurate results.
any one has idea how to solve this problem ?
please tell me if there any changes in code .
********************
function to solve differential equation
***************************
function dz = myeqd(t,y,ti,fi2)
dz = zeros(3,1);
mu=0.7;
r= sqrt(y(1)^2 + y(2)^2);
K=2;
%w=40;
F=interp1(ti,fi2,t);
dz(1)= (mu - r^2)*y(1) - y(3)*y(2) +K*F;
dz(2) = (mu - r^2)*y(2) + y(3)*y(1);
dz(3) = (-K*F) * (y(2)/sqrt(y(1)^2 + y(2)^2));
**************************************************
main function
**************************************************
[fi fs]=wavread('sound1'); % /* read file into memory */
fi2 = fi(:,1); % left coloumn vector
tt= 0:1/fs:(length(fi2)-1)/fs; % time vector
ti=tt;
[T,Y]= ode45(@(t,y) myeqd(t,y,ti,fi2),tt,[10;10;10]);
plot (T,Y)
*********************************
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!