Appreciate helping me with this lab assignment.

1 次查看(过去 30 天)
  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 个)

Community Treasure Hunt

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

Start Hunting!

Translated by