delay signal by 'n' samples
Ältere Kommentare anzeigen
Suppose I have a wav signal and want to delay it in matlab by 'n' number of samples, could someone please tell me how I could do it?
Thanks in advance
Akzeptierte Antwort
Weitere Antworten (3)
Walter Roberson
am 15 Nov. 2011
delayed_signal = [zeros(1,n) original_signal];
Unless that is, the signal is a column vector, in which case
delayed_signal = [zeros(n, size(original_signal,2)); original_signal];
1 Kommentar
Padma
am 15 Nov. 2011
Wayne King
am 15 Nov. 2011
Why? Seems to me that the way Walter gave you works.
original_signal = randn(10,1);
n = 5;
delayed_signal = [zeros(n,1) ; original_signal];
[c,lags] = xcorr(delayed_signal,original_signal);
stem(lags,c);
[~,maxlag] = max(c);
fprintf('Signal is delayed %d samples\n',lags(maxlag));
Jannatul Ferdous
am 30 Jan. 2019
x=[1 2 3 4];
subplot(3,1,1);
stem(x);
title('X');
y=[1 1 1 1];
subplot(3,1,2);
stem(y);
title('Y');
z=x+y;
subplot(3,1,3);
stem(z);
title('Z=X+Y');
1 Kommentar
Walter Roberson
am 18 Jul. 2019
The relevance of this is not obvious?
Kategorien
Mehr zu Descriptive Statistics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!