Time shift a signal and save the new signal

6 ビュー (過去 30 日間)
fadams18
fadams18 2022 年 10 月 21 日
回答済み: charan 2025 年 6 月 19 日
I have two signals. one is a clean speech signal and the other is an egg signal.
The speech signal is a bit late. So I want to shift the speech signal to start at the same time as the egg and save this new signal. is that possible?
Ive attached the two signals here. Any insights, and ideas will be appreciated.
  1 件のコメント
Mathieu NOE
Mathieu NOE 2022 年 10 月 21 日
hello
I am intrigued that you want to shift one and not both signals or maybe (and this is what I would assume) you simply want to remove the same amount of initial samples on both signals
once you have loaded th wav files (with audioread) , you can simply remove the required amount of signals by doing (on both data sets) :
data(1:samples) = []; % samples = Fs*start_time I want

サインインしてコメントする。

回答 (1 件)

charan
charan 2025 年 6 月 19 日
Hi,
If you want to align the signals in time domain you can try using correlation. Using correlation you can find the lag between the signals. Shifting the signal by the same amount (as the measured lag) can align both the signals. You can either pad zeroes to one signal or trim the other. You can use the "xcorr" function in MATLAB to calculate the correlation.

カテゴリ

Help Center および File ExchangeSignal Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by