Maker Pro
Maker Pro

Suggestions on how to eliminate 'click'

C

Charlie E.

Jan 1, 1970
0
Hi All,
Ok, I have been bashing my head against the wall all day, again, and
once more request my betters show me the correct path...

Here is the problem I have. I have been trying to improve the audio
quality on my color readers. It presently uses ADPCM, which is
decoded and used to adjust the bandwidth on a PWM output on my PIC24,
fitered by a fourth order Sallen filter into my amplifier. The audio
is very scratchy, and has received very mixed reviews from users and
retailers.

So, How to improve it? By experiment, I have tried to just use
standard 8 bit PCM recorded audio. It does sound better, but at the
end of each sample is a very noticable 'click.' I can't be absolutely
sure what is causing it, but I think that it is due to the final value
in the file that indicates termination is so low (0x04) that the
sudden transition may be the source of the click. It isnt my turning
the power amplifier on and off, I have tested that...

So, any ideas? Anyone else dealt with this sort of thing before?

Thanks,
Charlie
 
C

Charlie E.

Jan 1, 1970
0
Hi All,
Ok, I have been bashing my head against the wall all day, again, and
once more request my betters show me the correct path...

Here is the problem I have. I have been trying to improve the audio
quality on my color readers. It presently uses ADPCM, which is
decoded and used to adjust the bandwidth on a PWM output on my PIC24,
fitered by a fourth order Sallen filter into my amplifier. The audio
is very scratchy, and has received very mixed reviews from users and
retailers.

So, How to improve it? By experiment, I have tried to just use
standard 8 bit PCM recorded audio. It does sound better, but at the
end of each sample is a very noticable 'click.' I can't be absolutely
sure what is causing it, but I think that it is due to the final value
in the file that indicates termination is so low (0x04) that the
sudden transition may be the source of the click. It isnt my turning
the power amplifier on and off, I have tested that...

So, any ideas? Anyone else dealt with this sort of thing before?

Thanks,
Charlie

Ok, so that works. How do you solve a problem? Ask someone else so
that you think about it a little different!

Final view of problem? Final value output was termination value, not
actual data, causing a click.

Solution? Delay each value by one cycle, so that the termination
value has a chance to terminate the loop before it is output!

Now, to go find an icepack for my poor forehead... ;-)

Charlie
 
C

Charlie E.

Jan 1, 1970
0
yes, it is most likely that. When turning off a stream you need to
decay it..

Just view the last sample or next to the last ones and pad some
decay at the end. This means you'll need to have a few bytes sitting
around where you can see them for inspection before they go out the
door.

I don't know how you are actually turning things off? are you just
ending a stream of PCM bits or actually electrically turning off an
output via a IO bit or hard switch?

I am shocked you don't have at least a basic scope to see all of this
happening ?

Jamie

Hi Jamie,
Tried it on a scope. I have a nice Rigol here on the bench. However,
these voice samples are about half a second each. The unit doesn't
have enough memory to clearly see the end if I keep the time step
large enough to see the end... :-(

Was especially fun when trying to see the 'raspy' audio output!

Charlie
 
J

Jamie

Jan 1, 1970
0
Charlie said:
Hi All,
Ok, I have been bashing my head against the wall all day, again, and
once more request my betters show me the correct path...

Here is the problem I have. I have been trying to improve the audio
quality on my color readers. It presently uses ADPCM, which is
decoded and used to adjust the bandwidth on a PWM output on my PIC24,
fitered by a fourth order Sallen filter into my amplifier. The audio
is very scratchy, and has received very mixed reviews from users and
retailers.

So, How to improve it? By experiment, I have tried to just use
standard 8 bit PCM recorded audio. It does sound better, but at the
end of each sample is a very noticable 'click.' I can't be absolutely
sure what is causing it, but I think that it is due to the final value
in the file that indicates termination is so low (0x04) that the
sudden transition may be the source of the click. It isnt my turning
the power amplifier on and off, I have tested that...

So, any ideas? Anyone else dealt with this sort of thing before?

Thanks,
Charlie
yes, it is most likely that. When turning off a stream you need to
decay it..

Just view the last sample or next to the last ones and pad some
decay at the end. This means you'll need to have a few bytes sitting
around where you can see them for inspection before they go out the
door.

I don't know how you are actually turning things off? are you just
ending a stream of PCM bits or actually electrically turning off an
output via a IO bit or hard switch?

I am shocked you don't have at least a basic scope to see all of this
happening ?

Jamie
 
J

Jamie

Jan 1, 1970
0
Charlie said:
Hi Jamie,
Tried it on a scope. I have a nice Rigol here on the bench. However,
these voice samples are about half a second each. The unit doesn't
have enough memory to clearly see the end if I keep the time step
large enough to see the end... :-(

Was especially fun when trying to see the 'raspy' audio output!

Charlie

I also have a Rigol as one of many scopes I have, Use the average,
peak detect or glitch detect option, I forget what it's called now
on the Rigol, I have to many scopes to play with, they are all a little
different in description :)

Jamie
 
P

Phil Allison

Jan 1, 1970
0
"Charlie E."
Here is the problem I have. I have been trying to improve the audio
quality on my color readers. It presently uses ADPCM, which is
decoded and used to adjust the bandwidth on a PWM output on my PIC24,
fitered by a fourth order Sallen filter into my amplifier. The audio
is very scratchy, and has received very mixed reviews from users and
retailers.


*** 8 bit PCM can sound OK ** IF ** you properly "dither" the samples.

Dither converts the gritty modulation noise into a smooth hisssss - far
more acceptable.


So, How to improve it? By experiment, I have tried to just use
standard 8 bit PCM recorded audio. It does sound better, but at the
end of each sample is a very noticeable 'click.' I can't be absolutely
sure what is causing it, but I think that it is due to the final value
in the file that indicates termination is so low (0x04) that the
sudden transition may be the source of the click.


** If an audio signal is terminated abruptly, by switching or other means,
there is usually an audible click.

The click sound is worst if the signal drops from a maximum to zero but even
terminating at a zero crossing does not eliminate the click.

The two most popular solutions are to always wait for silence before
terminating or else rapidly FADE the signal to zero over a period of time
like 50 or 100 milliseconds.

Obviously, there are hardware and software ways to do both things.


..... Phil
 
C

Charlie E.

Jan 1, 1970
0
_One_ bit PCM can sound good, if you dither it right. And 1st-order
sigma-delta converters are easy to whomp up. You don't have enough speed
in a processor to do just one bit -- but this technique on audio, to get
telephone-quality audio from one pin on an FPGA, and I've used it
numerous times to extend DAC resolution in control systems:

http://eetimes.com/design/embedded/4006431/Sigma-delta-techniques-extend-
DAC-resolution

Thanks Tim and Phil,
Well, now that I have the 8 bit straight PCM figured out, I of course
find that I don't have enough memory! The original ADPCM basically
took 16 bits down to 4, so I had the same length of sound in half the
space that my 8 bit samples take up. Since I had, of course, pretty
much maxed out my memory previously, I am not left with only half
enough memory... :-(

Do you think dithering would help the raspy sound of my ADPCM output?
Interesting note: In the code I am adapting, the actual PCM output
cycle is running at 16KHz and it used the same value twice each sample
to acheive 8KHz resolution. perhaps dithering between the two cycles
would give me less noise?

Charlie
 
C

Charlie E.

Jan 1, 1970
0
Just to clarify, what I mean is that by compressing the dynamic range of
the audio file and keeping its RMS level high, you make sure that it's
always well above the noise floor.

Ok, another interesting fact. The routines that write to the PWM
register shift it to only use 10 bits! So, it takes a 4 bit ADPCM
sample, decodes it to 16 bits, and then throws six bits away! No
wonder it sounds raspy...

Charlie
 
T

Tom Del Rosso

Jan 1, 1970
0
Charlie said:
Ok, so that works. How do you solve a problem? Ask someone else so
that you think about it a little different!

It often works for me. It forces you to define the problem clearly.
 
T

Tom Del Rosso

Jan 1, 1970
0
Joel said:
Here's a bizarre news story from the past few days:
http://abcnews.go.com/US/church-sta...group-students/story?id=16012844#.T3YCAtXLu9H
. In brief: A church staged a fake kidnapping -- complete with a real
(albeit unloaded) AK-47 and a pastor made up to appear bloody and
bruised -- of their youth group ostensibly to help them better
understand Christian persecution.

I'm sure that "lesson" is indeed going to be "memorable" to all of
those involved... especially some of the adults who should be facing
jail time for pulling off such nonsense.

I had a memorable lesson once. In Catholic grade school the substitute
teachers were always strangers from other schools, but for religion class
the sub was a nun or priest since they always had a lot of free time.

One day the substitute was Father McGirl. He described an event in which a
crowd of people "spoke in tongues" and "fire danced on their heads."

"What do we call that...Mister Del Rosso?"

"Uh, the Feast of the Immaculate Conception?"

Father McGirl made a very long scream as if in agony, and threw himself
against the black board in a crucified position.

He hung there motionless for several seconds.

Then he turned around and said, "P-E-N-T-E-C-O-S-T!!!"

That was a very effective teaching technique. I still don't know what the
Feast of the Immaculate Conception is, but I never forgot Pentecost.
 
Top