- #1

matlab audio

- 3

- 1

- TL;DR Summary
- writing chua oscillator to an audio file using matlab

hello i would like to ask how to write the solution of this matlab program to an audio file using the audio tool box or any other technique. thanks very much.

https://www.mathworks.com/matlabcen...ads/submissions/44972/versions/1/download/zip

https://www.mathworks.com/help/audio/index.html?s_tid=srchtitle_audio_1

```
function chua_oscillator
%This program is computed by S.Sabarathinam
%Based on: Nonlinear Dynamics: Integrability, Chaos and Patterns,by M Lakshmanan, S Rajaseekar
% to see the period doubling change the value of "r"
clear all
figure(1)
r=1920.0;
ga = -0.758d-03; gb = -0.409d-03; c1 = 10.0d-09; c2 = 100.0d-09;
bind = 20.0d-03; a = r*ga; b = r*gb; alpha = c2/c1;
beta=(c2*r*r)/bind;
%time step and initial condition
tspan = 0:0.01:500;
x10 = 0.11; x20 = 0.2; x30 = -0.3;
y0 = [x10; x20; x30];
[t,y] = ode45(@(t,x) f(t,x,a,b,alpha,beta),tspan,y0);
x1=y(:,1); x2=y(:,2); x3=y(:,3);
%plot the variable x and y
plot(x1,x2)
function dy = f(t,y,a,b,alpha,beta)
x1 = y(1); x2 = y(2); x3 = y(3);
hx=b*x1 + 0.5d0*(a-b)*(abs(x1+1.0)-abs(x1-1.0));
dx1=alpha*(x2-x1-hx);
dx2=x1-x2+x3;
dx3=-beta*x2;
dy = [dx1; dx2; dx3];
```

https://www.mathworks.com/matlabcen...ads/submissions/44972/versions/1/download/zip

https://www.mathworks.com/help/audio/index.html?s_tid=srchtitle_audio_1

Last edited: