increasing amplitude of sine wave
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Mohamed Turkmani
il 1 Set 2022
Commentato: Les Beckham
il 1 Set 2022
hi i want to create i simple sine tone that has increasing amplitude kinda like a fade in 3 seconds
i wrote the following code its just a normal sine tone with Frequency is 3000 hz and amplitude of 1
Fs = 44100;
dt = 1/Fs;
StopTime = 3;
t = (0:dt:StopTime-dt)';
Fc = 3000;
A = 1;
y = A*sin(2*pi*Fc*t);
sound(y,Fs)
how can i make the amplitude start from 0 and inrease linearly to 1 in 3 seconds like a fade?
0 Commenti
Risposta accettata
Les Beckham
il 1 Set 2022
Fs = 44100;
dt = 1/Fs;
StopTime = 3;
t = (0:dt:StopTime-dt)';
Fc = 3000;
A = linspace(0, 1, numel(t))';
y = A.*sin(2*pi*Fc*t);
plot(t,y)
grid on
2 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Special Functions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!