I am building a sound application, similar to
AVR335: Digital Sound Recorder with AVR and Serial DataFlash.
The ADC with 5V reference captures 8-bit long sound data @ 8KHz
sampling rate with min=0 and max=255.
The whole thing is working ok.
Now I want to detect the clipping of the audio input, in order to
inform the user to decrease manually the volume control
(or better, do it automatically with a digital potensiometer,
like a digital AGC).
The sinus waveform with 8-bit samples(generated with matlab),
shows 7 continuous samples of 255($FF) and 0($00) respectively.
So, the clipping detection algorithm should not be triggered by
only 7 continuous $FF or $00 but more, but how many?
Or is this not a good way to detect clipping?