As we start looking into Class-D audio, we want to see what’s going on above the audio band. Now, a new instrument arrived – a spectrum analyzer with integrated tracking generator. It is the Rigol DSA815. For its price, the build quality is very good. Unfortunately we have to get some test cables with N-plugs first. Therefore we can’t say much about it now.
I did some tests with the HiFiBerry Digi prototype today. As expected, everything worked without problems with 44.1/48 and 96kHz. A test with my EMU-0404 showed exactly, what I expected: no digital data could be received over the optical link at 192kHz. It’s not a problem, that’s just what the interface in this device is specified for.
Have a look at this oscilloscope picture. You see, that the signal frequency is 12.27MHz.
But then I did another test with the optical input of my iMac (an old model from 2009). And I was really surprise to see, that it received correct data even at the highest bit rate! That means, the receiver in this Mac is capable to receive SPDIF inputs of more than 10MHz – nice.
What are your experiences with the optical input on your DAC? I’m interested which DACs support this.
A long time ago I had a look on the Raspberry Pi onboard sound on the oscilloscope. It looked really terrible. The sound also wasn’t good. That was the beginning of the HiFiBerry DAC development.
But how bad is the onboard sound really? How bad is it compared to our DAC?
Lets have a look on the oscilloscope. We played a 1kHz sine wave on both the onboard output and the HiFiBerry DAC. Check it out:
It is not hard to see, that the onboard sound (left) ist not really a sine wave. Why is it that way? The onboard sound is not using a real DAC, but a simple pulse-width modulation (PWM). While PWM is also used in good Class-D amplifiers (and works well there), the PWM circuit on the Raspberry Pi is trivial and not build for high fidelity sound.
Have a look at the distortions of both circuits:
You clearly see, that there are much more noise and distortions on the onboard sound. The onboard-sound cannot provide high quality sound. However, we’ve seen circuits that were even worse than this one.
You want to use the Raspberry Pi for high-quality audio? Use an external sound card or our HiFiBerry DAC.
Today we had a look at the noise and distortions of the HiFiBerry DSP light. They look promising. Noise is not a problem at all – which is not the case for every DSP that is available on the market. The distortion figures are a bit above the typical distortions from the datasheet, but still at an acceptable level below 0.01%. The low noise figures show, that the PCB design works well with its clear separation of the analog and the digital part of the circuit.
Note that these figures are measured with a very cheap power supply and the Raspberry Pi connected to the DSP and running. That means all major noise sources, except the Ethernet port, are already included in this measurement.
For our measurements, we use the E-MU0404 USB sound card. Its DACs and ADCs support samples rates up to 192kHz and up to 24bit precision. But how good is the card really? We did a short loopback test with inputs directly connected to the outputs of the card. Unfortunately only unsymmetrical cables were available.
Setup was the following: Windows ASIO driver, 48kHz sample rate. ARTA was used for measurements. Let’s have a look at the noise and distortion figures:
The diagram does not show the noise component, because it is almost non-existent. The datasheet states -117dB. All higher order distortion components (D4+) and D2 are below 0.001%, only D3 is above 0.001% above 1kHz, with a maximum of about 0.003% – very good.
But why didn’t I use 192kHz sampling rate? Most DACs and ADCs have their lowest distortions at the lower sample rates. Does this also happen with the E-MU 0404?
This looks almost as the 48kHz measurements. There is a small glitch, but I’m not sure if it comes from the card or the measurement setup (software?). That means, the card is performing very well at the full range of sampling frequencies – great. Note, that the frequency scale is different – it now goes up to 50kHz.
Here are some noise and distortion measurements of the HiFiBerry Mini DAC. Without the ethernet connected, noise is practically non-existing. But also distortions look good. D2 has the highest level and higher-order noise is decreasing with each order. This is really a nice chip.
At 1kHz we see 0.0037% THD+N (distortions alone only 0.003%). However, the measurement equipment itself (an EMU0404) itself has a THD+N level of 0.002% at this frequency (in- and output together). Therefore the real noise and distortion figure might even be a bit smaller.
We also did tests at other frequencies and they look similar:
Note, that these measurements are a bit flawed, because at higher frequencies there are less harmonics within the measurement frequency range than at lower frequencies. Therefore the distortions go down. Unfortunately I was not able the extract the D2 and D3 levels alone.
There are more good news. The voltage regulation on the board works great. Even with the worst power supply I could find (a Nokia charger), the figures did not change much. THD+N went up from 0.0037% to 0.004% at 1kHz. That means there is no urgent need to upgrade the power supply of your Raspberry Pi.
Update 1.12.2013: We did some THD+N measurements of our production version. They were even lover than the values show here.
The PCM5102 is a nice I2S DAC. We use it in you HiFiBerry Mini DAC. It is easy to use, because it does not need a master clock and can run on a single 3.3V power supply. To generate a full 2Vrms signal, the chip uses an internal charge pump (with two external 2.2uF capacitors) to generate a negative power supply.
Unfortunately the datasheet gives no information about the switching frequency of the charge pump. But it’s not a secret. You can simply have a look on the voltage on the external capacitor. What do we see? Switching frequency is about 850kHz – way out of the audible frequency range.
Update 13.11.13: It seems, that the charge pump frequency depends on the sample rate. We’ve seen even charge pump frequencies above 1MHz.
I did some measurements of the HiFiBerry DAC for the Raspberry Pi. Compared to the DAC in standalone mode, there was noticeable more noise when I connected the DAC to the Raspberry Pi. Ok, that was expected. There is a lot of digital switching on the Raspberry, this is not good for audio circuits. But then I noticed an interesting fact: Even if the Raspberry Pi was powered off, there was still some noise.
Where did it come from? The only cable that was still connected was the network cable. Hmm, what happens if I remove this cable?
Wow! Silence! The 750Hz peak was a problem in our measurement setup.
But where does this noise come from? When you connect the Raspberry Pi do an ethernet network, the data connection is galvanically decoupled using a transformer. However, if you use shielded Ethernet patch cables (STP), the ground of the Raspberry Pi (and your audio equipment) is connected to the Ethernet network. This is where all the noise comes from. The solution is simple: You should use unshielded twisted pair cables (UTP) to connect your Raspberry Pi to en Ethernet network or use WLAN.