Author Archives: remco

No, your VST plugin will not run on a cheap DSP.

Rant incoming.

Back in my uni days, I was a professor’s assistant teaching practical courses. A student came by to ask for a second power supply (each desk had one). Instead of giving him one which would be the easy thing, I asked why he needed it.

“I need split rail supplies” he answered.

Round 2. Why do you need split power rails?

“I need to supply an opamp”

(Yes, I know you can do that just fine with single supply. But I don’t think we’re there yet.)

Round 3… Why do you need an opamp?

“I want to light up an LED.”

Right.

Obviously, he walked away with the transistor he needed rather than the supply he asked for. Probably not happy with that annoying professor’s assistant and his pesky questioning. That was a lesson for him and for me: don’t expect gratitude even when you try to help people.

Fast-forward 20 years. Hello, grey hairs. Goodbye, slim waist.

What is better for [insert algorithm], a PC or a DSP?

The term DSP gets thrown around very easily because the world has gone digital and everything needs processing. We live in such a gluttony of resources that I’m sitting here with an 8-core i7 machine running 3.6 GHz just so that I can stare at a cursor blinking 0.5 Hz and enter some text. How this is legal still baffles me. And somehow we have even convinced ourselves this is normal. In fact, we have come to expect it and this is why people who work on embedded systems (like me) are running into problems we never expected – unreasonably unreasonable requirements.

“So, why use a puny SigmaDSP, Blackfin, Sharc, Cortex M4/FPU, XMOS, TMS320, etc etc when you have a great PC standing on your desk?”

PCembedded DSP
Raw clock cyclesseveral GHz1 – 500 MHz
Cores1-321-2 with dedicated peripherals
for specialized functions
Memorycheap and plentyexpensive and limited
Programmingalmost too easy

Design abstracting tools such as
Pure data, MATLAB (R)(TM)(WTF),
python widely available
at least knowledge of algorithmic
optimization required

for optimal results knowledge
of software layers, C coding

for bleeding edge intimate
knowledge of target processor
and machine assembly coding.
Timing accuracy and latencynot much below 5 ms, results
vary with hardware and OS load
guaranteed sample accurate, <1 ms,
down to a few ns on specialized
processors
Code density (aka MIPS per MHz)mostly NOPsmedium on a framework / HAL
high when bare metal C
insane when assembly optimized
Code power (aka MIPS per mW)~1 GFlops for 100 W =
10 MFLops/W
450 MFlops/W (ADSP-SC589
excluding HW accelerators)
1893 DMIPS/W (STM32F446)

Code cost (aka MIPS per $)~ 1 GFlops for $1000 =
1MFlops/$
900 MFlops / $36 = 25 MFlops/$
(ADSP-SC589excluding HW accelerators)
225 DMIPS / $6 = 37.5 DMIPS/$
(STM32F446)

The table above should yield a bit of insight. Even though I’ve pulled some of these numbers out of thin air, at least it indicates to roughly order of magnitude. It appears that when you need an algorithm application optimized for cost, power and efficiency (aka a product), you are going to need a embedded system of some sort. If you want to quickly develop a proof of concept and you have a PC standing around (who doesn’t?) then that is the obvious way to go.

Now comes the inevitable. Fancy schmancy algorithm XYZ is quickly developed on a PC and demonstrated successfully to customers, product managers and perhaps worst of all, investors. And the story is sold on the byline ‘“we just need a swift porting onto a DSP to go-to-market” and that is when the consultant’s phone rings.

“Can you just quickly throw this 16,000 tap FIR running at 192 kHz on a $5 DSP? Can you have it done in two weeks? That’s what we promised our investors.

If I haven’t hung up on you at this point, I will try to understand what you want before trying to figure out how to give you what you are asking for. Because after resolving the physical impossibilities and getting you to make up your mind whether to go over budget, spec, time planning or all of the above you still will end up with a very sub-optimal solution.

Embedded DSP designs are fundamentally different from PC algorithms.

That means, there is no porting an sich but rather a redesign. Your proof of concept is just that, and as smoothly as it runs on a quad i9-9900K, it needs 2GB of memory and 80% CPU, latency is anywhere from 200-800 ms and why on God’s green earth do you need 16,000 FIR taps at 192k to make a shelving filter at 85 Hz? The answer is without fault the same every time:

“We are doing something unique that we can’t disclose, so it has to be this way.”

OK, good luck building it yourself.

However if you want, I can give you the transistor and I will explain why that is by far a superior solution for your LED.

Here’s the takeaway: there is nothing wrong with running DSP on a PC. The thing is there anyway, easy to configure, no programming required so the creative souls can run free, sip their lattes and point-and-click something together. But when the end target is an embedded product at a certain [power, price, performance latency, project time line] constellation, you need to involve an embedded expert from the start. A non-optimized “secret sauce” algorithm, running on hardware tweaked out to the point of counting assembly instructions just to make it work, is at best sub-optimal and an affront to the hard-working DSP designer, at worst a nightmare from hell for the developers, project managers, customers, investors and in the end, the promising company. But hey- you get to keep your unique idea… all to yourself.

Setting the output voltage on a flyback switched-mode power supply

Yes, I am still alive. Sort of. 🙂

This should involve only about 3 people in the world, but hey, I should blog more even if the relevance is negligible. If this helps 1 person, I’m glad.

Not recently at all I bought a bunch of Yokogawa A1D03B supplies from Pollin (originally meant for HP printers). The idea was that they are nice to supply small / medium amplifiers for active loudspeakers. The output is 31.6V but I needed about 24V.

Continue reading

So, the cat’s out the bag

I had this project saved for later publication, but the first delivery seems to have succeeded quite well. Analog guru Duke Aguiar, who sells the LPT interface cable to the Audio Precision APIB bus (with a USB solution in the works!), has received and favourably tested my recreation of the AES17 compatible 20 kHz brick-wall measurement filter for Audio Precison System One/Two.

Before I knew what hit me there was already a review post up at DIYaudio!

The performance is stellar, like the original AP and much less costly

[source]

Brick-wall 20 kHz lowpass filter compatible with Audio Precision System One/Two

Now available for order – webshop here!

SACDenhancer revisited – part I

About four and a half thousand years ago, I designed (SA)CD player output stages with vacuum tubes and at some point came up with a transistor version, called the SACDenhancer.

Original version, ca. 2003 AD

In double blind tests this was a big preference over the built-in opamp solution. It spawned off a plethora of discrete output stages from various manufacturers and modification shops that were all the rage in the day. I had some pretty good spectrum analyzer but never could find definitive measurable differences between the standard output stage and this one.

Fast forward 15 years and I’m still getting requests for this design, so I had a PCB made. Both fabrication and measurement capabilities have moved quite a bit forward in the meantime.

Reboot, ca. 2016 AD. How nice you can now get solder mask in ‘UltrAnalog’ colour palette from China.

This version follows the original schematic but adds a second output stage for fully differential processing. As such the schematic stays ridiculously simple – just a long-tailed input stage and emitter follower output. Couldn’t be simpler (I tried. Believe me. It wasn’t good).

Basic performance

Test conditions unless otherwise specified – 1V rms differential, 997 Hz input, AES17 measurement filter, unweighted

THD+N : -99 +/- 0.5 dB

Best THD : 109 dB @ 0.7Vrms input

SNR: 100 +/- 2 dB

Frequency response linearity: +/- 0.02 dB, 20 Hz – 20 kHz

Gain linearity: +/- 0.025 dB

THD+N vs. Freq

THD vs Level

Crosstalk

Intermodulation, 1k sine 1:1 with swept sine from 60 kHz to 6 kHz

Good news – the performance indicators are all green: no defects. This is pretty much as well-behaved as you might expect from a discrete design. But while it clearly says there’s nothing wrong with how this will sound, it does not prove it will sound better than an opamp either.

Balls to the wall

So let’s pit this thing against an opamp stage and see what happens. In the left corner, representing the heavyweight class, the Analog Devices OPA275. The challenging contestant, some ridiculous discrete design from some dude in 2003 thinking they know better. All that and more, in part 2…

Outage

Just a quick mention about recent outage. It appears the site was taken over by a spotty teenager in his basement running CMS brute force scripts…

If that was you: hey contact me, I’ll send you some breadboards, tubes, transistors and an old oscilloscope. Go teach yourself electronics, one day you may find you have a nice job. I might even be the one to give it to you 🙂

Much to my chagrin, I can now add PHP to my skill set. I could have lived a long happy life not knowing a thing about PHP and just program in solder instead. If you do spot broken links or things not working, contact me.

Some recent comments (which were actually really nice and constructive) were unfortunately lost. Obviously I’ve tightened security and will make backups more frequently, but couldn’t avoid this. I have been really positively surprised about the level and the tone of comments on itsonlyaudio.com – such an enormous contrast to ultranalog.com back in the day! Please keep commenting!

One page I was in the process of writing was also lost, I’ll have to write it again, until then I’ll just leave you with a nice visual preview.

More soon…

Writing 24LCxxx EEPROMs with PICkit3

Since it took me about 8 hours to fetch all the information together and get it running, maybe this post will be useful for other loonies like me who think this is a good idea 🙂

You see, the Microchip PICkit3 seems like a steal – a cheap, full featured PIC programmer that can also write EEPROMs!

Well, they weren’t lying. Then again, it’s not exactly the truth either. Continue reading

Arduino software control for WM8804/WM8805

WM8804 application board (eBay) modified to output CLKOUT pin (yellow-black wire)

Recently I needed a special type of I2S signal, namely a 4 signal set of DATA, BCLK, FCLK and also an MCLK of 49.152 MHz.

Many modern DACs, DSPs and digital power amplifiers need this high clock frequency. And of course you would want this signal to be synchronous to the Frame Clock such that the converter has a fixed number of MCLK per FCLK cycles so as to minimize jitter.

Many S/PDIF receivers implement a fixed clocking in hardware mode which limits your options and flexibility, so it is worth exploring software control. It is really not so hard. Continue reading

Measuring USB devices with an Audio Precision System One or Two

There is one thing the older Audio Precision System One and Twos don’t have which can be quite annoying: they don’t have USB host functionality. And given that all the processing and clocking happens inside the unit, the control software can’t reroute the digital signal generator to a USB output.

Tenor T7022, an often-encountered USB receiver. Does it do bit correct feed-through?

Of course you can use a PC to feed the USB sound card and measure the output with the AP, but then you don’t have the generator signal to do e.g. sweeps or automation. The best of course would be to somehow get to a full loop starting at the AP signal generator back to the analyzer. After quite a lot of tinkering, I managed to do just that.

Continue reading

And now, for some music

Surely, you can’t have missed that Linn are giving away a bunch of 24 bit tracks at the end of the year?

Last year, I had to log in every day and still managed to miss a few days, luckily some buddies helped out and we got the collection complete.

This year, they’ve been extra generous and left the whole collection up for grabs until January 6th. So in thanking them I’ll happily plug the Linn site for all my readers (yes, both of you).

Linn Records – 24 bits of Christmas

As the year draws to a close and we prepare for many changes in 2015, I’ll plug in the same wm8741 that Linn use in the Klimax and enjoy the recordings. I’m not a big classic fan, but some of the recordings in this collection are absolutely breathtaking. Well either that or I’m getting older.

Enjoy and see you in 2015, which is shaping up to be a pretty exciting year!