How can I Implement a convolution function in MATLAB and perform it on the following signals and plot the results ?
Mostra commenti meno recenti
Hi guys,
I have the following function:
impulse_response = zeros(1, length(input) + length(delta) - 1 );
for t_samp = 1:length(input)
for c_samp = 1:length(delta)
index = t_samp + c_samp - 1;
value = delta(c_samp) * input(t_samp);
impulse_response(index) = impulse_response(index) + value;
end
end
I am new to Matlab and I want to understand how to Implement a convolution function in MATLAB and perform it on the following signals and plot the results ?
Task (1):
x[n] = [1,1,1,1] h[m] = [1,0,−1] x[n] = sin(n) h[m] = [−1,−2,8,−2,−1] 20 ≤ n < 20
Task (2): Given the input signal x[n]=0.3∗sin(n/5)+sin(n/50) : -Create your own delta signal h[m] that removes the higher frequency sinusoidal component to get yl[n].
Thanks in advance for your kind explanation.
2 Commenti
Walter Roberson
il 14 Mar 2018
Could you confirm that your n values are radians and not degrees?
Vaban Dust
il 15 Mar 2018
Risposta accettata
Più risposte (3)
Abhishek Ballaney
il 15 Mar 2018
Modificato: Walter Roberson
il 20 Ott 2020
1 voto
Ankur Agrawal
il 21 Set 2021
Modificato: Walter Roberson
il 29 Dic 2021
n = -20:20;
x = sin(n);
h = [-1,-2,8,-2,-1];
N = length(x);
M = length(h);
Ny = N + M -1;
y = zeros(1,Ny);
for i = 1:N
for k = 1:M
y(i+k-1) = y(i+k-1) + h(k)*x(i);
end
end
m = 0: Ny-1;
Abdullah Mohmmed
il 29 Dic 2021
0 voti
Write a MATLAB code to calculate and plot the two-sided convolution between the two discrete time signals x(n) and h(n) shown below
1 Commento
Walter Roberson
il 29 Dic 2021
No signal definitions were shown.
And if they had been, we would have just referred you to the discussion above, which includes full code.
Categorie
Scopri di più su Descriptive Statistics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

