How to play a variation of frequency?

4 visualizzazioni (ultimi 30 giorni)
jérôme TAÏEB
jérôme TAÏEB il 29 Set 2018
Hi,
1)Starting from a pure wave of a given frequency (4000 Hz) I can not implement this pseudo code to play a sound (pure wave) whose frequency decreases continuously from 4000 to 200:
demo matlab
t = (0:0.001:100)';
for n = 4000:-1:200
y = sin(2*pi*n*t)
sound(y,Fs);
end
How to implement this correctly?
2)same question but starting from an very short audio file or an sound sample
thanks
  3 Commenti
jérôme TAÏEB
jérôme TAÏEB il 2 Ott 2018
Modificato: Walter Roberson il 3 Ott 2018
corrected script:
t=0:0.001:100;
for n=200:1:4000
y=sin(2*pi*n*t);
sound(y,n);
end
Now:
How to create in format.wav the obtained result by adding and scripting ?
thanks
Walter Roberson
Walter Roberson il 3 Ott 2018
That code changes frequency in two different ways simultaneously. You should not do that. Either change the n used in the construction of y or else change the frequency used for playback, but do not do both.
Hint: changing the n used in the construction of y is much easier to put together into a single .wav file than if you change the playback frequency.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Audio I/O and Waveform Generation in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by