Convoluting two signals and correcting the time vector
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
n = -10:10; h3 = gauspuls(n-6); x1 = [1 1 1 0 0 0 0 0 0 0 0] conv(h3,x1) % Convoluting these two signals should only shift the x1 signal 6 steps to the right but I get a vector with 31 numbers and the shift of x1 is 17 steps to the right. How can I correct this?
0 commentaires
Réponses (1)
Anish Mitra
le 24 Fév 2016
Since the pulse signal, 'h3', is generated with a time range of -10:10, the output actually starts from n = -10. Hence the shift of 17 is actually a shift of 6.
n = 0:10;
h3 = gauspuls(n-6);
x1 = [1 1 1 0 0 0 0 0 0 0 0];
y = conv(h3,x1);
figure;
subplot(3,1,1);
stem(n,x1);
subplot(3,1,2);
stem(n,h3);
subplot(3,1,3);
stem(n,y(1:11));
0 commentaires
Voir également
Catégories
En savoir plus sur Subplots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!