help-octave
[Top][All Lists]
Advanced

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

Playing an array as sound and recording it's output in parallel


From: Rick T
Subject: Playing an array as sound and recording it's output in parallel
Date: Thu, 27 Oct 2011 12:16:36 -1000

Greetings All

I know octave can play arrays as sound but, I was wondering if Octave can do this.  I would like to cycle through a range of frequencies and have octave play them using the speaker out on my computer, and have octave also record the sound using the mic input to get the max value.  I'm trying to automate a way to have octave cycle through frequencies and record the data received so I can go back latter and look at the resonant frequencies.  Can Octave do this type of operation in parallel?

Example:

clear all

t=linspace(0,1,44100);

A = 1; % amplitude

Fs = 44100


for ii=1:1:10

     freq=ii; %how many in 1 sec

     T = 1/freq; % period of the signal

     vertoffset=0.5;

     % square

     square = mod(t * A / T, A) > A / 2;

     square = square - vertoffset;

     sound(square,Fs);

end;





reply via email to

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