Question in continuous time signals
조회 수: 1 (최근 30일)
이전 댓글 표시
I'm not sure about the represantation of a continuous time signal. Am I doing something wrong?
%%
DT = 0.01;
t = [-2:DT:12];
%% Question 2.1
%Parts of Signal
t1 = -2:DT:7;
y1_1 = (exp(abs(-0.5*t1))).*(2*sin(10*pi*t1)+cos(1*pi*t1));
t2 = 8:DT:12;
y1_2 = (0.75).^abs(-t2+10);
% Final Signal
%t = [t1 t2];
y1 = [y1_1 y1_2];
%% Question 2.2
%Parts of Signal
t1 = -2:DT:7;
y2_1 = (exp(abs(-0.5*(-t1-2)))).*(2*sin(10*pi*(-t1-2)))+cos(1*pi*(-t1-2));
t2 = 8:DT:12;
y2_2 = (0.75).^abs(t2+12);
% Final Signal
t = [t3 t4];
y2 = [y2_1 y2_2];
%% Conv Function
tconv = (t(1) +t(1):DT:t(end)+t(end));
F1 = conv(y1,y2)*DT;
stem(tconv,F1);
댓글 수: 0
답변 (2개)
Star Strider
2021년 11월 25일
Everything in a computer are discrete, not continuous (except the voltages on the chips themselves and the outputs of a soundcard or similar DAC transducers). So ‘continuous’ signals otherwise only exist in symbolic variables, not numeric arrays or vectors, since by definition those are all sampled.
The posted code is doing everything it should (or could) to represent the signal vectors correctly (although some variables appear to be missing).
%%
DT = 0.01;
t = [-2:DT:12];
%% Question 2.1
%Parts of Signal
t1 = -2:DT:7;
y1_1 = (exp(abs(-0.5*t1))).*(2*sin(10*pi*t1)+cos(1*pi*t1));
t2 = 8:DT:12;
y1_2 = (0.75).^abs(-t2+10);
% Final Signal
%t = [t1 t2];
y1 = [y1_1 y1_2];
figure % Added
plot([t1 t2], y1) % Added
grid % Added
%% Question 2.2
%Parts of Signal
t1 = -2:DT:7;
y2_1 = (exp(abs(-0.5*(-t1-2)))).*(2*sin(10*pi*(-t1-2)))+cos(1*pi*(-t1-2));
t2 = 8:DT:12;
y2_2 = (0.75).^abs(t2+12);
% Final Signal
t = [t3 t4];
y2 = [y2_1 y2_2];
%% Conv Function
tconv = (t(1) +t(1):DT:t(end)+t(end));
F1 = conv(y1,y2)*DT;
stem(tconv,F1);
.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!