matlab - How to clip the amplitude of a wav file? -


I am trying to detect the pitch of the signal using an auto-correlation function with a clipping function.
I have trouble clipping the clipfunction function.

I tried to: [sig Fs] = wavread ('sound.wav'); N = length (sig); For I = 1: N if sig & gt; CL SIGP (I) = CIG (i) -CL (I); Other sig & lt; -CL SIGP (I) = CIG (I) + CL (I); Other Sigp (I) = 0;

However, when I try to plot the clip part, the program is slow, and gives an empty plot.

Any thoughts?

You forgot to index the sig array in the conditional statement. See below:

  [sig Fs] = wavread ('sound.wav'); N = length (sig); For I = 1: N If sig (i) & gt; CL SIGP (I) = SIGG (I) -CL; Safe (I) & lt; -CL SIGP (I) = SIGG (I) + CL; Other Sigp (I) = 0;   

Let me know that this does not answer your question, and I'll give it another shot.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -