find_stats_rand.m - startgroove1 = 5 +...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 function [ssdmean, ssdstd_dev] = find_stats_rand(wavemat1, wavemat2, numgrooves, numsamples, numwindows) %$Revision: 1.2 $ $Author: pcalamia $ $Date: 2004/05/09 22:48:21 $ % find_stats_rand(wave_matrix_1, wave_matrix_2, #_of_grooves, #_of_samples, num_windows) % finds the mean and standard deviation of the sum of squared differences % over num_windows random pairs of windows from wave_matrix_1 and wave_matrix_2 global Gdebug [h1,w1] = size(wavemat1) [h2,w2] = size(wavemat2) ssd = zeros(1, numwindows) A = zeros(numgrooves, numsamples) B = zeros(numgrooves, numsamples) for i = 1:numwindows %pick a random start groove in each wave matrix(skip the first and last 5)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: startgroove1 = 5 + floor((h1-(numgrooves+10))*rand(1)) startgroove2 = 5 + floor((h2-(numgrooves+10))*rand(1)) %pick a random start sample in each wave matrix startsamp1 = ceil((w1-numsamples+1)*rand(1)) startsamp2 = ceil((w2-numsamples+1)*rand(1)) %compute ssd over the ith window A = wavemat1(startgroove1:startgroove1+numgrooves-1, startsamp1:startsamp1+numsamples-1) B = wavemat2(startgroove2:startgroove2+numgrooves-1, startsamp2:startsamp2+numsamples-1) ssd(i) = sum(sum( (A-B).^2)) end ssdmean = mean(ssd) ssdstd_dev = std(ssd) Sheet1 Page 2...
View Full Document

This note was uploaded on 04/20/2008 for the course ENGR 190 taught by Professor Staff during the Spring '08 term at Santa Clara.

Page1 / 2

find_stats_rand.m - startgroove1 = 5 +...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online