week 7 Flashcards
how do you graph crosscorrelation in matlab?
[xcor, xlags] = xcorr(signal1, signal2)
figure; plot(xlags, xcor);
[rxy, lags] = xcorr(x, y, ‘coeff’)
what if x and y are different lengths?
function appends zeros to the end of the shorter vector so both are the same length
peak correlation
tells us where the original signal is most similar to the reference signal
multiple correlations
shift wave over to find the best match between two signals
autocorrelation
cross correlation between a waveform and itseld
it is common to normalize autocorrelation function to ____ at lag ____
1
0
what is fs?
sampling frequency (Hz)
what is N?
length of data (ex: length(eeg))
what is t?
t = (0:N-1)/fs
or
t = (1:N) *Ts
time vector starting at 0
how do you plot cross correlation between two signals using the period?
t = (1:N) * Ts
[rxy, lags] = xcorr(x, y, ‘coeff’)
figure; plot(lags * Ts, rxy)
how do you find the max correlation in matlab?
[max_corr, max_shift] = max(rxy)
how do you do autocorrelation in matlab?
[rxy, lags] = xcorr(x, x, ‘coeff’)
cross covariance
measures the similarity of deviation of 2 signals about their respective means
autocorrelaton and autocovariance versus regular crosscorrelation and covariance
auto is between the signal and itself, looking to see how one segment of data is correlation on average with adjacent segments
(auto)covariance V.S (auto)correlation
basically the same but covariance has means subtracted from input signal