MATLAB Answers

0

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?

Matthew 님이 질문을 제출함. 25 Feb 2014
최근 활동 Thomas 님이 편집함. 25 Feb 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

please format you code using the {}code button..

로그인 to comment.

답변 수: 1

Thomas 님의 답변 25 Feb 2014
Thomas 님이 편집함. 25 Feb 2014
 채택된 답변

run your code as follows
a=SignalGen(10,200,1000,5,3,100); % suppress output Signal
sound(a) % to hear

  댓글 수: 0

로그인 to comment.



Translated by