Sound!

A "new fashioned" televisor, using an Arduino to drive the motor and display.

Moderators: Steve Anderson, Dave Moll, Andrew Davie

Re: Sound!

Postby Steve Anderson » Sat May 27, 2017 1:14 am

Well, OK, understood...but would you be willing to demonstrate it at a NBTVA convention as it is? (Assuming you could attend). You've done well, a credit to your programming skills, but I suggest taking it somewhat further as it only requires a bit more effort and the improvement will be worth it.

If you're still in the same field of 'real work' with submersibles it will help you there too. Really.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 3800
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Sound!

Postby Andrew Davie » Sat May 27, 2017 1:20 am

Steve Anderson wrote:Well, OK, understood...but would you be willing to demonstrate it at a NBTVA convention as it is? (Assuming you could attend). You've done well, a credit to your programming skills, but I suggest taking it somewhat further as it only requires a bit more effort and the improvement will be worth it.

If you're still in the same field of 'real work' with submersibles it will help you there too. Really.

Steve A.


I'm open to improvements - not shutting the door. But I'd like to make some progress on building the final machine because it feels like I've been working on this forever. I would be OK demo'ing it, but for the sake of full disclosure I have shocking hearing and wear hearing aids. Sound is not my strong suite and so detecting problems with it is also a major difficulty for me. As it is, it seems OK.

Not working with submersibles anymore. I completed that study/work, then moved on to flying autonomous "drones" in underground mines and have also left THAT field and now I'm at a bit of a loss really, but hoping to move into some augmented reality which I have an interesting concept for.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Sound!

Postby Steve Anderson » Sat May 27, 2017 1:39 am

Most of us go through changes in our career applications, mine was from radar, then to a radio station then into TV broadcast engineering where I have languished for the past 30 years or so. I should have got out long ago - but there it is.

Well, good luck wherever fortunes may take you. Not being 'funny', although the digital world pervades every aspect of our lives these days, the world and nature is analogue.

Even a humble NAND gate internally is analogue in it's nature and operation...seriously.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 3800
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Sound!

Postby Andrew Davie » Sat May 27, 2017 1:45 am

I put my phone next to the speaker, and isolated it from the noise of the disk/motor. Here's a recording - the first minute and a half is with the volume at about 20% and at 1:30 I change it up to 80%. Note that I am using a linear adjustment and I suspect it needs to be logarithmic, right?

In any case, you can judge for me how it's sounding. Remember, the actors are talking on the phone so some of the dialog should be sounding like it's a phone call (one person will be clear, the other phone-attenuated) depending on who is in the picture. In any case, this sounds OK to me. Interested in your views...

27 May 00.35.mp3
(1.05 MiB) Downloaded 93 times
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Sound!

Postby Steve Anderson » Sat May 27, 2017 1:54 am

Yes, normally a mechanical or 'wiper' type of control should be log for audio levels, all others, bass/treble etc are linear.

Steve A...I'm off to bed...
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 3800
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Sound!

Postby Andrew Davie » Sat May 27, 2017 11:05 am

Steve Anderson wrote:Yes, normally a mechanical or 'wiper' type of control should be log for audio levels, all others, bass/treble etc are linear.


I re-used the "gamma" logarithmic table for the volume swiper as well - it seems to work well. I take the swiper value (0-255), pass it through the gamma conversion table (0-255 but now logarithmic) and use that value as a multiplier of the signal. The volume control "feels right" as the volume change when I swipe it seems to do what you'd expect - wide range of volume from silent to loud. Nice that I don't need to add complexity with another table or extra code - it was just a few bytes for the lookup.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Sound!

Postby Steve Anderson » Sat May 27, 2017 11:18 am

Yes, the simplicity and speed of a look-up table assuming it doesn't dominate the memory space cramping you elsewhere.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 3800
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Sound!

Postby Andrew Davie » Sat May 27, 2017 5:07 pm

I thought I'd try out the larger speaker I bought. It's a 4 ohm about 10 cm diameter. I actually just measured the other - it was 5.5 cm diameter, so this one is nearly twice as much. I've had a good long listen to this, with the volume slider at various settings. There is no clipping on the Arduino side, due to the way I have setup the amplification - that is, the track stored on the SD is already at maximum volume, and the volume slider makes the audio quieter never louder. So when I have my volume slider at maximum, the original 8-bit signal gets to the amplifier. Well, just about not quite. I'm actually sending 255/256ths of the original due to the way the code turned out. All other volumes are a logarithmic-scale fraction of that. So any adverse effects are going to be in the RC filter or the amp. I did a video of a few minutes of Doctor Who, just to see how the thing sounds from various distances and at various volume settings. In summary I can't fault it, and I can't detect issues with noise/distortion. Of course, I'm hardly the person to judge due to my hearing but nonetheless, here is the result for review...


youtu.be/lXZhRQFiLbA

Note: There is a second or two offset due to an error on my part in converting the video. Ignore that!
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Sound!

Postby Klaas Robers » Sun May 28, 2017 7:17 am

Andrew, I see that the loudspeaker is now standing against a kind of box, where you have also screwed the display on. Can you not jigsaw a large circular hole in that box, somewhat more to the left, almost as large as the paper cone of the loudspeaker? Then you can screw the loudspeaker from the front into that hole, or from the back, if you like, such that there is NO SLIT between the chassis of the speaker and the wooden front of the box. So the fit should be air thight. You will see that you get much MORE sound and also better sound than what you have now. Don't bother what is behind the speaker. The table will be part of the baffle, it closes the front board at the bottom, and the top board in front of the disc also extends the baffle at the top.

What you do now is the worst thing that you can do. It is a pitty for the loudspeaker that you are using. This baffle will give you the best "amplifier" that you can think of. And it is free; cheaper than Ali Express ever.
User avatar
Klaas Robers
Frankenstein was my uncle.
 
Posts: 1431
Joined: Wed Jan 24, 2007 8:42 pm
Location: Valkenswaard, the Netherlands

Re: Sound!

Postby Andrew Davie » Sun May 28, 2017 12:58 pm

Klaas Robers wrote:Andrew, I see that the loudspeaker is now standing against a kind of box, where you have also screwed the display on. Can you not jigsaw a large circular hole in that box, somewhat more to the left, almost as large as the paper cone of the loudspeaker? Then you can screw the loudspeaker from the front into that hole, or from the back, if you like, such that there is NO SLIT between the chassis of the speaker and the wooden front of the box. So the fit should be air thight. You will see that you get much MORE sound and also better sound than what you have now. Don't bother what is behind the speaker. The table will be part of the baffle, it closes the front board at the bottom, and the top board in front of the disc also extends the baffle at the top.

What you do now is the worst thing that you can do. It is a pitty for the loudspeaker that you are using. This baffle will give you the best "amplifier" that you can think of. And it is free; cheaper than Ali Express ever.



I could, Klaas, but this is just a temporary mount for things. I plan to build a completely new and beautiful "housing" for the whole thing. So there's little point worrying about the mount/box right now. But I understand your comments about the correct way to get more and better sound, and will keep that in my plans. I would like to build something really striking. This one I really like...

Image
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Sound!

Postby Andrew Davie » Sat Jun 17, 2017 7:02 pm

Introducing... the wine cask speaker system.
Not high fidelity but by the time you've emptied the cask you don't really care...

winecaskspeaker.jpg
winecaskspeaker.jpg (186.65 KiB) Viewed 3073 times


It's clear to me that I'm over-amplifying the sound on the Arduino side. When it's "normal" all is OK, but by the time I amplify to about 3/4 of the slider range it distorts terribly. Volume when normal is OK, not great. Good enough for a demo televisor, not good enough to enjoy watching/listening. Anyway, thus is my response to "put the speaker in a boxed enclosure".
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Sound!

Postby Andrew Davie » Sat Jun 17, 2017 10:05 pm

Here's a short video of my "wine cask speaker" running. The funny thing is, I forgot to connect the RC filter and this is playing direct from the PWM signal on the Arduino output pin. Towards the end of the video you get some "close up" of the sound... I don't think it's too bad, really. But then again, I'm a really poor judge of these things.


youtu.be/82I5qBfUsyY
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Sound!

Postby Steve Anderson » Sun Jun 18, 2017 2:01 pm

Certainly placing the speaker in a box like that will improve efficiency but the sound on male speech could become 'wooly' due to resonances in the somewhat flimsy box. But it's better than nothing.

The distortion may be simply you're overdriving the amp, the signal needs to be attenuated. If you replace the 'little filter' but change the values as follows...

Resistor between PWM output and input of the amp = 10k,
Capacitor from resistor/amp input junction to ground = 2n2,
Add 10k resistor across 2n2 cap.

This will do the filtering as before but attenuate the signal by a factor of two approximately. So for the same sound level you'll have to move the volume slider higher. If it's now too quiet adjust (reduce) the series resistor to 4k7. If it's still overdriving the amp increase it. You may have to fiddle around for a while.

As for it working without the filter it's probably the roll-off of the audio amp doing the same job, all the same I would put the filter back in.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 3800
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Sound!

Postby Andrew Davie » Sat Jul 01, 2017 4:31 am

Steve Anderson wrote:Certainly placing the speaker in a box like that will improve efficiency but the sound on male speech could become 'wooly' due to resonances in the somewhat flimsy box. But it's better than nothing.

The distortion may be simply you're overdriving the amp, the signal needs to be attenuated. If you replace the 'little filter' but change the values as follows...

Resistor between PWM output and input of the amp = 10k,
Capacitor from resistor/amp input junction to ground = 2n2,
Add 10k resistor across 2n2 cap.

This will do the filtering as before but attenuate the signal by a factor of two approximately. So for the same sound level you'll have to move the volume slider higher. If it's now too quiet adjust (reduce) the series resistor to 4k7. If it's still overdriving the amp increase it. You may have to fiddle around for a while.

As for it working without the filter it's probably the roll-off of the audio amp doing the same job, all the same I would put the filter back in.

Steve A.


Aha! Found this post.

OK, I don't think I need to do this, because I have programmatic control. The sound is designed such that in the sorce data it is already "maximum volume" and the concept is that it is only reduced in volume so that there is never any "saturation clipping" or whatever it's called. So, source data can only be "turned down". That turning-down is controlled bye volume slider which is a multiply by a fractional logarithmic value based on the slider position. So rather than attenuating the signal with the capacitor/resistor modification suggested, I attenuate the signal by changing the response of the volume slider code. My conclusion at the moment - I can use the RC filter as-is, and modify the source code.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Sound!

Postby Andrew Davie » Wed Jul 05, 2017 11:36 pm

I was thinking about the problems with my demo today, particularly with the sound. Symptoms are that things go OK until the sound kicks in and then the system resets. I had a look at the PAM8302 datasheet and in particular the graph showing (8 ohm speaker) output power vs voltage (5V). That reads about 1.5W - which I figure means that the current draw is about 300 mA. Now I understand the total current that can be drawn on the 5V line on the Arduino is 500mA (hard to find data on this); it could be 500mA total including output pins. If so, 300mA is a big hit. So I'm thinking perhaps a more sensible solution in V3 board is to supply the PAM8302 with its own 5V via a regulator.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

PreviousNext

Return to Andrew Davie's Arduino Televisor

Who is online

Users browsing this forum: No registered users and 2 guests

cron