trying to give audio input signal to ode but getting inaccurate results
5 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!