How come I keep getting this error message?

1 view (last 30 days)
Edgar
Edgar on 29 Apr 2014
Edited: Star Strider on 30 Apr 2014
  6 Comments
Star Strider
Star Strider on 30 Apr 2014
Edited: Star Strider on 30 Apr 2014
The ‘song’ variable magically appears as an argument to var in line 35, and again in 39 and 40.
FWIW, we seem to have successfully resolved the clipping problem in How come I keep getting "Data Clipped" in my Command Window?.
The solution there was to scale it by:
s = s/max(abs(x)+1E-4);
Nothing less than 1E-4 works for some reason.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 30 Apr 2014
You will get that error if song+noise is less than -1, or is greater than or equal to +1. You need to either clip the data or rescale it.
  2 Comments
Edgar
Edgar on 30 Apr 2014
Would it be possible for you to show me the code that I would need to add in order to fix this issue? And where would I add it in my code?
Walter Roberson
Walter Roberson on 30 Apr 2014
Geoff's comment about using "fur" was a good point; I was looking at the warning message and thinking it corresponded to the wavwrite() that is on the screen. The hidden wavewrite() has the same problem, though: the values in fur(), being constructed from sin(), sometimes assume the value 1.0 which is out of range.

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!