Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - mickmad

Pages: [1] 2
I surely will; first of all, I'm giving up on designing an over-the-top power supply, and will stick with using an ATX power supply, which already has +/- 12 V for the amps, and +5/+3.3 V for the rest of the board. Second, I will stick with the datasheets' input and output filter circuits, which are obviously tested to be within the converters' specs. I know that sticking with those filters will limit me to balanced only line input, and balanced/unbalanced line output, with no analog "volume" control for either part. And of course the input will not accept a guitar; but still, if the whole thing works as it should, then the problem reduces to adding a guitar/unbalanced frontend for the input filter, and an attenuation frontend to the output filter.

Roly, you made the point. TIME is the real "threat" here; the thing that worries me most is the USB audio class firmware implementation; luckily, I've had some good news from my electronics teacher: he said that the prototype construction, from pcb to actual population of it, should be taken care by the university, along with the costs associated; so I can try to achieve a very good quality product, with the advice of another teacher of my university., who is involved in mixed signals circuits :) also, it will leave me more time to actually debug the hardware and the software, since the device will be made just outside Rome I will avoid huge delays caused by ordering the pcb in China and then having to populate it by myself :) I will keep you up with this project ;)


Thanks Kaz for your help, the preamp section is something that it's still driving me nuts, along with the supply problem... first of all, I'd like to clarify something more technical about this audio interface.

I'm designing this whole thing around two Wolfson chips, namely the WM8786 ADC and the WM8740 DAC, which are 16-24 bit @ 192KHz max. converters. They both have amazing specs, with 111 dB of SNR and -102 dB THD for the ADC, and 120 dB of SNR and -104 dB of THD for the DAC; also, both have differential input/output! I will interface both chips to the I2S bus of a microcontroller, the Freescale Kinetis K20 ARM Cortex-M4.

At this point of development, though, I decided to lay down a prototype board which will have a PSU, a pre section, a post section, an ADC section and a DAC section. The pre and post section are going to be, just for the sake of prototyping, the basic one that are suggested on the datasheets of the chips.

I need to filter both input and output signals, and this is done via active filtering with ultra low distortion opamps. Wolfson reccomends the MC33078 opamp for the filter section, with corner frequencies of 12.5 Hz and ~1MHz, roughly a 1MHz bandpass on both in and out. Other signal filtering is done digitally inside the chips, so that's nice.

The output filter section (the post) also has an AD797 as a differential to single-ended converter, for ultra-quality unbalanced line output.

I've seen the page you linked, and that's the subject of my sleepless nights during the whole last week! Mixed signals circuits are a pain in the a** to layout properly. And the fact that I may want to selectively test the ADC or the DAC looks like a problem; I'm currently aiming the prototype design to be as modular as possible. I want separation between ADC, DAC, preamp, postamp, and psu sections, so that I can debug any part of the whole thing alone. But this means that I have to split the pcb in multiple pcbs, which means multiple, separate, ground planes; which means possible EF antennas could create if I bridge some parts of the circuit over separate ground planes.... UGH!! My brain hurts!

In fact, I still got to finish the whole design as I want a nice, all-around, preamp, with selectable input impedance, and selectable, input-impedance dependent, gain control; I thought of something like a simple inverting buffer, with a switch to select between 1M input impedance and x20 gain, or 10K input impedance and x1 gain; this way I could plug a guitar and give it some good gain, or plug in a simple line output with no gain over it. I also want an attenuator stage; so my idea was in reality a fixed, selectable gain stage, with an attenuation stage. I also want to keep the gain-attenuation controls separate for each channel. The fact that I'm working with a balanced input ADC doesn't help either, as I might as well need to duplicate this circuit to make a balanced, fixed gain stage and attenuator... but this means that I will be using stereo pot for each channel, and big switches. This is more pain in my brain. And remember that I need to filter the input signal, so this gain-attenuation stage will and must be followed by the specified active filter. Considering the ideal setup, with balanced or unbalanced input, gain stage, attenuation, and filter, I should need 2 opamps for the gain-attenuation stage, and 2 opamps for the filter stage, for each channel; using the MC33078, which is a dual opamp on a single IC, I should need 4 ICs just for the input section. Add a pair of stereo potentiometers and a pair of something like QPDT switches (quad pole to dual throw, I don't even think they exist!), the preamp section easily became power demanding and expensive.

The output stage is somewhat simpler,; altough there is no analog gain control over it, I might use the DAC internal 256 levels attenuation circuit; I thought something like: read value with microcontroller from a random pot, map it to 8 bit and then pass it into the DAC. Simpler than it looks.  As I said, the post has already been designed as a balanced-unbalanced output, with an AD797 as a differential receiver to single ended for the unbalanced out. As for the preamp, a channel of the post section needs a dual opamp for the active balanced filtering, and a single opamp for the unbalanced output. So that's another 4 ICs.

Total: 8 opamp ICs for pre and post, two of which cost more than 7 € each (the AD797). Luckily, the MC33078 costs only ~0.5 € each, and for its specs that's way cheap, but then comes the cost of the switch and the stereo pots, which will easily outstand the cost of the opamps to which they would be connected to. Moreover, the supply I've designed, which is based around a Murata switching DC-DC converter module, with 12 V @ 0.5 A input -> +/-9V output @ +/-111mA, could not bear the whole circuit current requirements, as I have to get 5 V from it to power the microcontroller and the converters; considering that the microncontroller will consume ~30mA in idle mode, max 100mA when everything on it is used, and adding ~55 mA to power both converters, and adding the current drop from the 5V regulator and the 3.3 V regulator that is aside the microcontroller and that will drive the digital section of the converters... well it looks like I'm well out of power.

But let's forget price and power, for a moment. The main, real, important, and difficult problem is : NOISE. There's going to be huge amounts of noise into the converters, even if I suddenly become the master designer of mixed signals; I've made my math this night, and from the specs given by Wolfson, at least for the ADC, the SNR is 111 dB, with a 0dB signal of 2 Vrms. It means that the ratio of the 0dB signal amplitude in Vrms and the noise amplitude is around 10^(111/20) = 345813.389etc ; so the actual input noise to the ADC that is reckognized as zero signal is 2 V rms / 345813 = 5.63676 uVrms (u = micro). BUT, the thermal noise of a 1MOhm resistor, at 25 Celsius (which is the same temperature condition of the datasheet specs), over a bandwidth of 96Khz (assuming that the converter is working at 192KHz gives us a maximum input frequency of Fs/2 = 96K) is something like 12.5 uVrms; around 2.5 times higher than the zero input signal. Given that the usable range in Volts for the converter is ~ 5.65 Volts, the converter has an error of 1 bit if there's a difference in Volts of 5.65 / (2^24 - 1) = 0.337 uVolts. Given also that the peak to peak value of the 1MOhm noise is 35.52 uVolts, and removing the 5.63 uVolts of unreckognizable signal, it gives us around 30uVolts of error; dividing this value by the 1 bit error in volts gives us 89, which is the number that will be represented in bits when the noise of the resistor is converted. That's more than 7 bits of error! How can I possibly have a 1MOhm resistor in this circuit at all?!

I'm going so nuts about this thing, I haven't slept for more than 4 hours a day for a week straight, and then when I think that my design could be somewhat good, it is totally not! I really don't see that much need of using 24 bits converters in a circuit that easily obscures ~8 bits with white noise! I wanna use almost every bit out of it! I want it to perform! That's why I'm going to write an email to my electronics teacher and see if he can clarify something. I was thinking that I could plug in an instrumentation amplifier, as seen in all those electronic books, and use the uber high input impedance of the opamp alone. Don't know much, though. I might have been saying loads of bulls*** all the time.

The fact is: I'm 2 exams due to my graduation, the exams are in the next few weeks, my graduation admission deadline is September 24th, I still got to study for both exams (Microeconomics and Complex Calculus, btw), and I still got no design ready to send in production. Consider that I'm in a tight economic situation, so I need to use cheap chinese PCB fabbers, and the min. estimated order-to-delivery time is around 2 weeks (paying extra bucks to UPS); also, consider that I'm designing this thing in SMD technology, and I alone will be soldering it; give in that I still have to exercise on SMD soldering techinques (though those are overlymystified)... I think this is going to be a nightmare.

Link to the datasheets:

Btw: sorry for the wall o' text, but these questions are really driving me crazy and I could not explain my point without a deep insight of it.

The Newcomer's Forum / Re: New Guy with an interesting design idea
« on: April 13, 2013, 10:02:36 AM »
Hey there, nice to see that you finally found something that could suit your needs :)
I'm kinda new to preamp designing, but I think that this setup should work; the things I'd do is to check that the preamp signal that goes into the final amp doesn't exceed the maximum input values of the TDA2005, and lay down the two sections on separate board so that you could plug them together later, just to rest assured that if they do not fit well together, like you are not happy with the way they sound together, you can easily separate them, and maybe reuse 'em; like, you could keep the preamp if you like it, and plug it on a more powerful final amp, for example. :)

The Newcomer's Forum / Re: New Guy with an interesting design idea
« on: April 08, 2013, 08:43:06 PM »
Hello there, welcome to the forum!

The whole cigar box guitar thing is just amazing! I never heard of this kind of diy guitars and it's very interesting! When I got some time I'll definitely go to my local flea market and look for a nice cigar box to do one myself! :D

By the way, maybe I got something for you: I got a Marshall M2-S which is a mini Marshall amp, powered by a 9 volt battery, with clean and distorted channel, and that thing ROCKS! It's very small, but powerful, and when the battery is at the end of its life, the distortion channel degenerates to a very cool fuzz tone!

I was going to tell you that there's no schematic of it, but I just found it!

This guy talks about a little mod he has made to its mini marshall, and was kind enough to add the whole schematic of the mini amp too! Hope you'll like it ;)

edit: just found out this topic on the forum: with schematic, give it a look because there is an alternate version of that amp with a different op amp, the original op amp used in it is very hard to find

Amplifier Discussion / Re: Powersonic
« on: April 07, 2013, 01:10:10 PM »
I agree with Roly, a few shots of the inner guts of the amplifier would be nice!
Btw, it looks like you could plug in two guitars, and one channel also has an integrated tremolo effect. Nice stuff! If it works, could you post some audio clips?

@Phil: if it resembles a Marshall Amp output, then I'm on a good road! :D

By the way, the output of that filter is going to be fed in a standard Line receiver, like that of a mixer input, or of an active monitor speaker.
But since the input signal of this filter/driver is an analog conversion of a digital signal, it could encounter some really harsh noise due to D/A conversion around the sampling frequency of the D/A converter, which ranges from 44KHz to 192KHz.
That's why I'm cutting a lot of high frequencies (I got -80dB/decade after 10KHz); I preferred to cut not too much around the low frequencies (I got 5 Hz at around -20dB) because I want to leave more room to the basses; if a potential user wants less basses, then he could cut them away.

In short terms, I want to achieve a somewhat powerful bass response, flat response over audible range, and total removal of very high frequencies components due to digital noise in the circuit. Hope that helps to understand better ;)

edit: I added a final gain reducer stage to the line driver; this way I can control the output volume with a potentiometer ;) I will post the revisioned schematic when I finish the preamp section, so to make a single post with all the nice stuff :D

I'm not doing a cab simulation, I'm doing some simulations of a guitar preamp to 1 Vrms, a line preamp (reducer) from 2 Vrms to 1 Vrms, and a line driver with low pass and high pass filter. Actually I'm working on the last one, I'm finetuning the filter to achieve an flat response filter like a C-weight filter, or something like that, cutting frequencies below 10 Hz and above 22KH, with a 2x gain in the passband region; I'm testing different solutions right now, as you can see in the posts :)

edit: after hours of twiddling, studying, changing filter topology, smoothing Q, and banging my head on a wall, I finally got it! I won't be touching this output filter anymore: first, I'm connecting the DAC output to an input buffer, which biases the signal and cuts some low frequencies; the biased hi-passed signal is fed into a unity gain Sallen-Key lo-pass, its output fed to a passive lo-pass; then another Sallen-Key lo-pass, identical to the first one, gets the first stage out and smooths it again, while boosting up the signal with a 2X gain, its output fed to a passive hi-pass; with this topology, I got a really nice bandpass, with a steep cutoff below 10 Hz and over ~22KHz. Again, I'm uploading schematic, .asc file, and Bode plot of input,first stage output ,and second stage output, which clearly shows the super steep cutoff. NEAT!

Ok, I got that wrong, again! XD

I've removed that faulty cap and added another stage of lowpass filtering before the 100 ohm out resistance and decoupling cap; I'm attaching .ASC circuit file, new schematic, and bode diagram of output signal just after the op amp (in RED) and after the last low pass stage (in GREEN).

The whole filter, as you can see, is actually a bandpass, with a passive high filtering stage before the op amp double pole stage; looks like a decent roll off for me near 100KHz, but still it doesn't convince me...

edit:I had some problems uploading the photos... btw I also noticed that chaining two filters like this maybe is what I was looking for, I can still get a 2 Vrms output, with straight gain from 10 Hz to 20 KHz, and significantly reduce any high frequency component. I'm also adding the two stage schematic, with corresponding bode diagram and .ASC file; this time, GREEN signal is the output of the first stage, the BLUE signal is the output of the second stage. The image clearly shows the much steeper cutoff above 10 KHz.

post-edit: I'm thinking that I should change the title of the thread because it is no longer about the preamp only, but rather it's about a single supply implementation of preamp and line driver for my audio interface.

Actually OUT refers to the line output; that final resistor and capacitor were there to simulate the input impedance of a line input, like the input of an active speaker, and the stray capacitance, like the capacitance of a cable connected.
It was flawed of course :D

I'll edit the last post with a correct schematic for it. I've also added a dc coupling cap of 10uF which works great, and fixed the offset voltage to 2.88, because I've found that the lowest output was somewhat distorted near 80mV above ground, this way the signal should be right in the range.

Ok, I got my hands on LTSpice IV, which I've never used before, to do some tesing before actually ordering PCBs, and I got the DAC output line driver and low pass filter done; I'm using the LT1413 instead of the LM358 you suggested, mainly because LTSpice only has built-in Linear Technology devices, and because I can't get the LM358 symbol to show up in the devices; but they're kinda the same chip so it's not a problem.

First, I drew the filter schematic that's on the WM8569 datasheet, and using the LT1413 in single supply mode, but a test with an input sinewave would show only half wave on the output; using that setup with a double supply eventually adjusted that.

But, I prefer using a single supply rather than deriving a negative voltage out of a positive one, so I biased the whole thing at 2.8 V (I will do that using a low dropout voltage regulator) and it works! I've attached schematic and a plot of a 1 Vrms sine signal at 10KHz in input and the resulting 2 Vrms output; the second image clearly shows that the resulting output is actually 2 times the input signal. The preamplifier section will come soon. I would be glad if anyone could do some further testing as I'm really new to SPICE simulation.

edit: added corrected schematic, removed wrong one.

You know what? I'll lay down a schematic for a dual preamp, it will work with a switch to select which of the two preamp use;the first one will be an hi z simple jfet preamp, nothing fancy; the second will be a 3 Vrms line receiver to 1 Vrms out; this way I can lay down a pcb with codec,in pre and out amp, order it and start debugging for the next month (the pcb manuacturer takes about 4 weeks from order to delivery of 5 50x50mm boards @ 9.9 $, slow but cheap). The idea is to actually starting to test the whole setup rather than whine all day about which pre to use or not to use... Also, this way I could have a potentially good setup for the final project, and I will also have the opportunity to test other guitar-specific preamps if I make them to output 3 Vrms and interface them as line inputs! For me, this sounds killer! What do you think?

The Newcomer's Forum / Italian newcomer alert!
« on: March 31, 2013, 05:05:02 PM »
Hello there everybody! I'm Mick (actually it's Michele, read Mee-kay-le), I'm 22, I live in Rome and I'm attending computer engineering, hopefully I will graduate in the next months! I play guitar since I was 10, I played lots of different kinds of music, although staying always in the rock neighbourhood, and eventually I ended up being a death thrash progressive metal player full-time, even though I still find myself soloing some blues in the spare time ;) The full-time means that when I'm not studying or keeping alive my social connections, I play that kind of music :) I also have a Newgrounds page where I keep my musical stuff, which I get to update once in a while... Actually I uploaded a new track last week :D

Right now I'm studying for my finals, I got two tests in April, and I'm working on my final project, which is an USB audio interface tailored to guitarists. I got an open topic in the preamp section about it as I'm currently facing some interfacing problems between the guitar and the ADC.

Well, hope I will give some good contribution to the forum :) btw here's the link to my audio page and to the last track I uploaded: - my newgrounds page - my last track

So, well, that's me. :D

I'm doing this project alone, at home, so I'm trying to keep the design simple, low cost, but efficient and as much professional-level as I could get it. I'm also trying to design it not to be a one-off prototype, because I'd like to maybe take it to a small run production stage, or even a big run if I get lucky :D For the first final product I'd like to make something that could be sold in a DIY kit.

Thanks Roly for the little schematic, I will try to study that a bit, and see if I can lay down a similiar approach to get a line level (2 Vrms) input interface to the ADC. For the output stage, I still got nothing new; I will probably just remove the pump-charge opamp and copy-paste the WM8569 recommended output filter circuit around the LM358, which fixes the gain to 2x to get it to line level. Should probably work fine.

Of course, I'd like to have more headroom for the ADC input signal, so that I could interface it with a more powerful preamp; when I first thought of this project, I wanted to give a potential user the power to change the preamp stage, like it was some sort of module that connects to the main board; it could have been a transistor pre, a valve pre or whatever. Maybe, to achieve this, I could design an onboard input buffer for the ADC which gets a very powerful signal, like above-line level (4 Vrms, 5 Vrms, dont really know), and then reduces it to 1 V rms, basically it should be an amplifier circuit with sub-unity gain; this way I could interface this input buffer with a variety of preamps... is it a good idea? Is it feasible?

You can't have 2 or 3 V RMS out of a 5V DC supply, period.
You mention an Op Amp which has an internal charge pump .... meaning it generates higher voltage.
Confirming you can't really avoid it, one way or another.
Personally I'd use one of the rail voltage converters (Maxim, etc.) to get proper Op Amp approved rails ..... which allows me to use any Op Amp I like instead of tying me to a specific one.

I, for one, feel quite uncomfortable with an iron ball tied to my ankle, no matter if the chain is long or not.

Well, after a whole day bashing my head on a wall, I must admit that you're totally right, I can't avoid using a double supply; I'd probably simplify my life if I decide to put in the design, say, a 9 V input with regulated 5 V and 3.3 V output, which are still necessary to power my microcontroller and the codec.

By the way, I made a mistake, I actually have both single ended ADC input and DAC output at 1 V rms; so I got to:

1)bring guitar level from 0.2 - 0.3 Vrms to 1 Vrms
2)eventually add a level input, in which case I'd need to bring 2-3 Vrms down to 1 Vrms
3)design a new output stage to bring 1 Vrms DAC output to 2-3 Vrms to match the new double supply

Actually I've seen many integrated instrumentational amplifier which could do a neat job on bringing the guitar level up to 1 Vrms, like the INA826, but I still haven't seen anything to reduce the input level signal. Probably I'll still leave out the level input for now, as I said this is going to be tailored to guitarists; I'll focus more on the guitar input part.

The INA826 looks like a very nice part, but I can't quite get the right value for the gain controlling resistor; I'd like to have a potentiometer to control the gain factor between 1 and 11; the datasheet says that the overall gain is 1 + (50 Kohm / Rg) where Rg is the gain controlling resistor; of course, the unity gain is achieved when Rg is an open circuit, and the 11 times gain is achieved when Rg=5 Kohm... do you think it is possible to achieve a similar result with just a pot? Or should I use a transistor below the saturation point and a potentiometer to bias the drain so that it works as a transresistor?

Any suggestion is well appreciated :)

Pages: [1] 2