This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
vpde_lecture35 [2020/04/23 08:26] trinh |
vpde_lecture35 [2020/04/23 08:33] trinh |
||
---|---|---|---|
Line 39: | Line 39: | ||
The rest is about more fun stuff. | The rest is about more fun stuff. | ||
- | ===== Real sounds from instruments ===== | + | ===== Pitch modification |
- | + | ||
- | ===== Tuning music and beats ===== | + | |
< | < | ||
Line 61: | Line 59: | ||
sound(fA, 659.3/ | sound(fA, 659.3/ | ||
</ | </ | ||
+ | |||
+ | ===== Tuning an instrument ===== | ||
+ | |||
+ | < | ||
+ | % Example of tuning | ||
+ | Fs = 2^13; T = 8; | ||
+ | t = 0:1/Fs:T; | ||
+ | |||
+ | % This is how tuning works. Play a 440Hz note with an off-tune 442Hz note | ||
+ | % signal | ||
+ | f = sin(2*pi*440*t) + sin(2*pi*442*t); | ||
+ | sound(f, Fs) | ||
+ | |||
+ | %% | ||
+ | |||
+ | % This is easy to show mathematically. When you add two sine waves together | ||
+ | % that differ very slightly in frequency, it gives a beating pattern | ||
+ | plot(t, f) |