I am creating a project that will record a sound sample from the world, for example, a bird's chirping. And then through pitch scaling, I could create different notes.
I first tried to change the sampling rate fs below in the Matlab code, and I noticed that it will change both the duration and the pitch. After some research, i found out this method is called sample rate conversion. but I still do not quite understand why with a higher sampling rate, the octave created will sound slower and lower, and vice versa.
It would be really helpful if someone could provide some insight into this. Thank you in advance!
function [x1, x2, x3, x4, x5, x6, x7] = signal_generator(n1,n2,n3,n4,n5,n6,n7,fs) % n is the signal frequency, fs is the sampling frequency m = fs; % how many samples per second t = 0:(m-1); x1 = sin(2*pi*n1/fs*t); x2 = sin(2*pi*n2/fs*t); x3 = sin(2*pi*n3/fs*t); x4 = sin(2*pi*n4/fs*t); x5 = sin(2*pi*n5/fs*t); x6 = sin(2*pi*n6/fs*t); x7 = sin(2*pi*n7/fs*t); end