Appreciate helping me with this lab assignment.

1 view (last 30 days)
  6 Comments
Amr Ashraf Hafiz
Amr Ashraf Hafiz on 15 Jun 2020
I couldn't compose a 20 secs audio piece of music as it is asked to do in step 19
Walter Roberson
Walter Roberson on 15 Jun 2020
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.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!