Multi sine waves function
20 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kanard
el 5 de Mayo de 2018
Comentada: Star Strider
el 5 de Mayo de 2018
Hello, right now I don't know how to create a multi sinus function with frequency from 1kHz to 2 kHz, with Amplitude varies from 0.25 to 1, in time from -2.5 to 2.5 second. I have tried with a loop 'for' but the problem is matrice t and f can't multiply with each other because of size.
for f = 1000:200:2000
A(n) = 1:-0.75/(length(f)-1):0.25;
V(n) = A(n)*sin(2*pi*f.*t + phi);
end
can someone help me with this?
Respuesta aceptada
Star Strider
el 5 de Mayo de 2018
I’m not certain what result you want.
Your posted code doesn’t show any oscillations when I run it. I would change the argument of the sin function to divide by the number of elements of ‘t’ in order to show the oscillations:
V = V + A(1,i)*sin(2*pi*f(1,i)*t/numel(t) + phi(1,i));
Beyond that, I have no suggestions.
2 comentarios
Star Strider
el 5 de Mayo de 2018
My pleasure.
Your code calculates and plots the evolving sum of all the waveforms, so if that’s what you want to do, it’s working.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!