Appreciate helping me with this lab assignment.

1 vue (au cours des 30 derniers jours)
Amr Ashraf Hafiz
Amr Ashraf Hafiz le 15 Juin 2020
Commenté : Walter Roberson le 15 Juin 2020
  6 commentaires
Amr Ashraf Hafiz
Amr Ashraf Hafiz le 15 Juin 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 le 15 Juin 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.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by