// // wavetrack.sci // // ------------------------------------------------------------------------ // copyright 2007 Alfred Steffens Jr. // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- // Copying Permission: // // This is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation. // // This software is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this software (see file called "COPYING"); if not, write to // the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, // MA 02111-1307 USA // ------------------------------------------------------------------------ // // // 3rd step for creating frequency tracks for additive synthesis. // (run this after "timetrack.sci") // S1 = size(freqmat); Rows = S1(1); Cols = S1(2); wavemat = zeros(freqmat); wavearray = zeros(1, Cols); pi2 = 2 * %pi; for k = 1:Rows, y = realmat(k,:).*cos(pi2 * freqmat(k,:) .* xd) - imagmat(k,:).*sin(pi2 * freqmat(k,:) .* xd); wavemat(k, :) = y; wavearray = wavearray + y; end mx = max(abs(wavearray)); wavearray = wavearray / mx; wavwrite(wavearray, Fs, 'wavearray.wav');