Align Wave

版本 1.1 (3.0 KB) 作者: Wei-Rong Chen
Time-align two wave signals by shifting wav2 to be aligned with wav1, using cross correlation.
362.0 次下载
更新时间 2021/3/16

查看许可证

% Time-align two wave signals by shifting wav2 to be aligned with wav1, using cross correlation.
% The inputs 'wav1' and 'wav2' can be either a string of filename or a
% struct in a format such that : 'wav1.s' contains the wave signal in a nSample x 1 vector and 'wav1.sr' is the sampling rate.
%
% All channels in input wav1, wav2 will be averaged before cross correlation comparison.
% The output 'y', 'sr' are modified signals for time-aligned wav2.
% The time of wav1 is alway preserved.
% 'delayT': "Delay" of wav2 with respect to wav1, which means wav2 was "sampled later" (i.e., signals of interest appear "earlier") than wav1 in 'delayT' sec,
% or earlier (if delayT is negative. i.e., signals of interest appear "later") than wav1 in '- delayT' sec.
% 'ifplot': if you want to plot the aligned results. Default = 0.
% 'SaveAsFName' : save the time-aligned wav2 to a specified file. Set to 0 if you don't want to save a file.
% 'resampleSR' : resampling the signals to a common resampling rate. Set to 0 to use the lower sampling rate in wav1 and wav2. Default = 8000;
% 'StartCompareTimeInWav1' : time point (sec.) in wav1 at which the CC comparison starts. {default = 0 sec.}
% 'corr_coeffs' : correlation coefficients.
%
% DEMO:
% StartCompareTimeInWav1 =1.9; % comparing starts from 1.9 sec in wav1;
% [y, sr, delayT] = AlignWave('1.wav', '2.wav', 1, 'alignedwav2.wav', [], StartCompareTimeInWav1);
%
% Weirong Chen 03-23-2014
% Modified Feb-23-2017

引用格式

Wei-Rong Chen (2024). Align Wave (https://www.mathworks.com/matlabcentral/fileexchange/50473-align-wave), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2012a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Correlation and Convolution 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1

Update

1.0.0.0