cross-correlation

How to limit cross correlation window width in Numpy?

你。 提交于 2019-11-28 01:03:24
问题 I am learning numpy/scipy, coming from a MATLAB background. The xcorr function in Matlab has an optional argument "maxlag" that limits the lag range from –maxlag to maxlag. This is very useful if you are looking at the cross-correlation between two very long time series but are only interested in the correlation within a certain time range. The performance increases are enormous considering that cross-correlation is incredibly expensive to compute. In numpy/scipy it seems there are several

Perform autocorrelation with vDSP_conv from Apple Accelerate Framework

不羁的心 提交于 2019-11-27 14:09:14
问题 I need to perform the autocorrelation of an array (vector) but I am having trouble finding the correct way to do so. I believe that I need the method "vDSP_conv" from the Accelerate Framework, but I can't follow how to successfully set it up. The thing throwing me off the most is the need for 2 inputs. Perhaps I have the wrong function, but I couldn't find one that operated on a single vector. The documentation can be found here Copied from the site vDSP_conv Performs either correlation or

Use convolution to find a reference audio sample in a continuous stream of sound

最后都变了- 提交于 2019-11-27 14:08:24
in my previous question on finding a reference audio sample in a bigger audio sample, it was proposed, that I should use convolution. Using DSPUtil , I was able to do this. I played a little with it and tried different combinations of audio samples, to see what the result was. To visualize the data, I just dumped the raw audio as numbers to Excel and created a chart using this numbers. A peak is visible, but I don't really know how this helps me. I have these problems: I don't know, how to infer the starting position of the match in the original audio sample from the location of the peak. I

Matlab Template Matching Using FFT

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 07:54:20
I am struggling with template matching in the Fourier domain in Matlab. Here are my images (the artist is RamalamaCreatures on DeviantArt): My aim is to place a bounding box around the ear of the possum, like this example (where I performed template matching using normxcorr2): Here is the Matlab code I am using: clear all; close all; template = rgb2gray(imread('possum_ear.jpg')); background = rgb2gray(imread('possum.jpg')); %% calculate padding bx = size(background, 2); by = size(background, 1); tx = size(template, 2); % used for bbox placement ty = size(template, 1); %% fft c = real(ifft2

Cross-correlation in matlab without using the inbuilt function?

不羁的心 提交于 2019-11-26 20:59:32
问题 can someone tell how to do the cross-correlation of two speech signals (each of 40,000 samples) in MATLAB without using the built-in function xcorr and the correlation coefficient? Thanks in advance. 回答1: You can do cross-correlations using fft . The cross-correlation of two vectors is simply the product of their respective Fourier transforms, with one of the transforms conjugated. Example: a=rand(5,1); b=rand(5,1); corrLength=length(a)+length(b)-1; c=fftshift(ifft(fft(a,corrLength).*conj(fft

Use convolution to find a reference audio sample in a continuous stream of sound

痞子三分冷 提交于 2019-11-26 16:39:02
问题 in my previous question on finding a reference audio sample in a bigger audio sample, it was proposed, that I should use convolution. Using DSPUtil, I was able to do this. I played a little with it and tried different combinations of audio samples, to see what the result was. To visualize the data, I just dumped the raw audio as numbers to Excel and created a chart using this numbers. A peak is visible, but I don't really know how this helps me. I have these problems: I don't know, how to

Matlab Template Matching Using FFT

*爱你&永不变心* 提交于 2019-11-26 13:54:50
问题 I am struggling with template matching in the Fourier domain in Matlab. Here are my images (the artist is RamalamaCreatures on DeviantArt): My aim is to place a bounding box around the ear of the possum, like this example (where I performed template matching using normxcorr2): Here is the Matlab code I am using: clear all; close all; template = rgb2gray(imread('possum_ear.jpg')); background = rgb2gray(imread('possum.jpg')); %% calculate padding bx = size(background, 2); by = size(background,