I'm trying to make a function to create a chirp signal with a clip distortion, when I run the function, It won't play and just displays columns, where is the problem?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Matthew
el 25 de Feb. de 2014
function Signal = SignalGen(StartFrequency, EndFrequency, Duration, Amplitude, ClipThreshold, Fs) Ts = 1/Fs; Time = 0:Ts:Duration-Ts; a = (EndFrequency-StartFrequency)/(2*Duration); b = StartFrequency; Theta = 2*pi*(100 + b*Time + a*Time.*Time); Signal = Amplitude*sin(Theta);
SigDistortion = Signal; for i = 1:length(Signal) if Signal(i) > ClipThreshold; SigDistortion(i) = ClipThreshold; end if Signal(i) < -ClipThreshold; SigDistortion(i) = -ClipThreshold; end end end
1 comentario
Respuesta aceptada
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!