Appreciate helping me with this lab assignment.

조회 수: 1 (최근 30일)
Amr Ashraf Hafiz
Amr Ashraf Hafiz 2020년 6월 15일
댓글: Walter Roberson 2020년 6월 15일
  댓글 수: 6
Amr Ashraf Hafiz
Amr Ashraf Hafiz 2020년 6월 15일
I couldn't compose a 20 secs audio piece of music as it is asked to do in step 19
Walter Roberson
Walter Roberson 2020년 6월 15일
for t = 0:time-1
xn=wrectT*cos(2*pi*f*t);
end
Every iteration of that loop, you overwrite all of xn .
for t = 0:time-1
xn(t+1) = wrectT*cos(2*pi*f*t);
end
Your code also needs to take into account sampling frequency. You need to sample at least twice as fast as your highest frequency note.
time=500;%half a second(0:500msec)
That implies you are thinking in terms of sampling once per millisecond, However, millisecond is only 1000 Hz and your last major cord is at 523.251130601197 Hz, so your sampling frequency needs to be above 1047 Hz.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by