Problem declaring a signal.

조회 수: 1 (최근 30일)
Mattias Eek
Mattias Eek 2021년 8월 10일
답변: Mattias Eek 2021년 8월 15일
I am a beginner in MATLAB and I'm studying for a test in Signal Processing and don't know how to tackle this some parts of this problem: "Using Matlab, convolve the two discrete-time signals: x1=(1/3)*(δ[n−1]+δ[n]+δ[n+1]) and x2 given by signal2.mat. Store the convolution (x1∗x2) in the variable x."
signal2.mat only contain the variable n which is an interval from -10 to 10 with a step of 1 and x2 which contain 21 random values.
I don't know what delta represents in x1 and how to implement/declare it in MATLAB. Any help is appreciated! I know what to do after I've declared x1, so further help than that is not needed!
  댓글 수: 1
Star Strider
Star Strider 2021년 8월 10일
The reference to is most likely the Dirac delta function, described in the Symbolic Math Toolbox dirac function.
.

댓글을 달려면 로그인하십시오.

채택된 답변

Sahil Jain
Sahil Jain 2021년 8월 13일
The "δ[n]" generally refers to the Dirac delta function. The following code will help you generate the required signal.
n=-10:1:10;
x1=(1/3)*(dirac(n-1)+dirac(n)+dirac(n+1));
More information about the Dirac delta function can be found on its documentation page.

추가 답변 (1개)

Mattias Eek
Mattias Eek 2021년 8월 15일
For anyone wondering how I solved this, here's my solution:
load = 'signal2.mat';
L = 21;
f = zeros(1,L);
mid = ceil(L/2);
for i=mid-1:mid+1
f(i)=1/3;
end
x1=f;
x = conv(x1,x2);
You can probably solve it using dirac, like @Sahil Jain mentioned above, but this worked for me.

카테고리

Help CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by