rate_from_align.m - This rate should agree relatively...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 function rate = rate_from_align(bundle) %$Revision: 1.1 $ $Author: mmccann $ $Date: 2004/05/07 03:17:42 $ %rate = rate_from_align([bundle]) - returns the sample rate in samples % per second based on the alignment data for the given bundle (1 by % default) and Grpm as was set by set_dir. This should be the % correct number to pass to wavwrite as the sample rate.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: This % rate should agree relatively closely with the value returned % from rate_from_track. global Gnum_scans Galigns Grpm if nargin < 1 bundle = 1 end load_aligns(bundle) total = 0 for i=1:Gnum_scans cur = i pre = mod(i-2,Gnum_scans)+1 diff = Galigns(cur).sample(1) - Galigns(pre).sample(2) total = total + diff end rate = round(total*Grpm/60)...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online