필터 지우기
필터 지우기

time domain and magnitude spectrum?

조회 수: 1 (최근 30일)
Abdelrazzak rifai
Abdelrazzak rifai 2018년 4월 17일
댓글: KALYAN ACHARJYA 2018년 4월 26일
A=0.5;
f1=6;
f2=10;
fs=32*f1;
fs2=32*f2;
phase=16;
t1=0:1/fs:2-1/fs;
t2=1:2/fs2:3-1/fs2;
phi=phase*pi/180;
x1=A*cos(2*pi*f1*t1+phi);
subplot(2,1,1);
plot(t1,x1);
hold on;
stem(t1,x1);
xlabel('time s');
ylabel('Amplitude')
x2=A*cos(2*pi*f2*t2+phi);
subplot(2,1,2);
plot(t2,x2);
hold on;
stem(t2,x2);
xlabel('time s');
ylabel('Amplitude')
  1. sum of cosine wave with different frequenciesbuild the time domain
  2. build it with the magnitude spectrumso my code is correct or wrong?

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 4월 17일
OK What you looking for. As per your code, I have not seen any error. You have generated two cosine signal having frequencies in 6 & 10 with amplitude 0.5.
  댓글 수: 2
Abdelrazzak rifai
Abdelrazzak rifai 2018년 4월 17일
my professor asked us the following question:
  • sum of cosine wave with different frequencies
  • build the time domain
  • build it with the magnitude spectrum
  • so my code is correct or wrong? please i need it tomorrow
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 4월 26일
Is your problem solved?

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

카테고리

Help CenterFile Exchange에서 Pulse and Transition Metrics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by