Digital Piano Reproduction: Phase Issues 1

Musicians often complain that their digital piano sounds good through headphones but terrible through an amp/PA, describing their live piano sound as “thin”, “nasal” or “boxy”.  This can be frustrating and musically uninspiring.  Because the piano sounds good through ‘phones, people naturally blame their amp/speakers and seek a solution there.

In fact the problem is in the piano: specifically, with phase issues introduced when the piano samples were recorded.  When stereo samples are recorded with two microphones simultaneously at different points in the piano cabinet (as they typically are), path length differences cause sound waves to arrive at the microphones in-phase at some frequencies and out of phase at others (e.g. when the path length difference is half a wavelength).  When the mic signals are summed to mono (either electrically at the piano’s mono output or at the mixing board, or in the air when the piano is amplified in stereo) the result is destructive interference of the out-of-phase spectral components.  This causes comb filtering that severely alters the timbre of the instrument, giving it a recognizable thin, nasal sound.

If one listens through headphones, the L/R signals are sent to different ears and are not summed (not even in the brain) so destructive interference does not occur.  The brain integrates the two sources of information, and one perceives something like the average timbre of the two recordings.  On digital pianos this works well and sounds natural.

Any recording engineer will tell you that if you record an instrument with two microphones, then you can’t just mix the two signals together unless you take great care with mic placement and/or post-processing.  Otherwise you get comb filtering, which sounds terrible.  And yet it’s a pervasive problem with digital pianos: an internet search for “digital piano phase” turns up lots of discussions among frustrated musicians, and the problem is well-enough known to warrant this article at keyboardmag.

Measured Spectra and Phase on a Yamaha CP50

Here are some measurements to back up my assertions.  Below are harmonic spectra for a single note (G4) recorded at the outputs of my Yamaha CP50 stage piano.  I recorded this note twice at the same strike velocity: once in stereo, and again in mono with a single phone plug in only the L/MONO jack (which simply sums the L+R channels) as recommended in the User Manual .  The following are mean spectra, computed from several overlapping length-8192 windowed FFTs of a 1-sec recording at 44kHz sample rate:

piano_spectra_g4While the individual L and R spectra are typical of a piano, the L/MONO spectrum certainly is not.  Relative to the stereo signal, the fundamental is down 16dB and the 3rd harmonic is down 10dB.  The 5th and 6th harmonics are completely absent.  The sound is thin and disappointing (that is, if you expected it to sound like a piano).

The spectra above are readily explained by destructive interference due to phase differences between channels.  Below is the phase of the R channel relative to the L channel, as measured by FFTs of 1-sec recordings of every note on the keyboard (click to enlarge):

So, for example, the note G4 produces a 393 Hz fundamental for which there is almost 180° of phase between channels.  Summing L+R channels to mono gives nearly total cancellation of this spectral component.  There are lots of other frequencies at which some note has a spectral component that drops out if L+R channels are summed, due to L/R channels being near 180° out of phase.

Basically the L/MONO signal is useless; it will sound bad through any amp no matter how good.

Solutions

It is impossible to fix this problem using any combination of linear filters on the stereo outputs.  If the piano appeared to the microphones as a point source, then the arrival-time delay between mics could be corrected by a simple delay.  But a close-mic’d piano is nothing like a point source, and the path length difference (hence phase shift at a given frequency) is different for every string on the piano.  That’s why the three phase curves shown above don’t track together above 200Hz.

At any given frequency the phase between channels depends on which string produced that tone, and thus whether that tone occurs as a fundamental, or 2nd harmonic, or 3rd harmonic, etc.  Any phase correction to one of these tones will end up compromising the others.

The Best Solution:

The only real solution lies with the manufacturer and the process used to record stereo samples.  Every sample should be individually delay- and/or phase-adjusted so that all harmonics produced by a given string are in-phase.  I would do the correction myself, but my CP50 won’t let me modify/replace its sample library.

Some Alternatives:

Here are some more practical options.  Each one is a compromise of some sort.  But the right combination of these might produce a sound that inspires…

1. Use a piano sample that was recorded in mono.

Hopefully your piano has one.  Mine does not.  Even if you have one that doesn’t sound great, it will still be lots better than a comb-filtered stereo-to-mono downmix.

2. Play in stereo.

Clearly this is how stereo samples were intended to be used.  But you will still get comb filtering when the L+R signals sum acoustically.  This will be most audible if the speakers are close together and/or close to the listener.  With speakers further apart and further away, the multiple room reflections will help decorrelate L and R signals before they sum at the ears.  This will limit the effect of destructive interference — hopefully to an acceptable level.

If you plug into the house PA in stereo, make certain the L/R channels get panned hard-left and hard-right at the mixer.  Any mixing to center will perform electrical summing of L+R channels, and you’re back to worst-case comb filtering.

But the house PA isn’t always stereo.  And having two speaker cabinets is expensive, inconvenient, and takes up more room on stage.  So we need a way to derive a decent mono signal from a stereo piano.

3. Put phone plugs in both L and R output jacks…

…but send only one of them to the amp/PA.  This defeats the electrical L+R summing (“jack normalling”) at the output.  On my CP50 I find this is a big improvement, but the timbre isn’t as natural as it is on headphones.

The problem here is that the signals on L and R channels have distinctly different timbres (as is clear from the spectra in the first graph shown above).  Neither one sounds natural on its own.  Probably this is because the piano sets up standing waves in its cabinet, and the L/R mics are just sampling two points in the standing wave pattern.  I would expect their spectra to differ quite a bit.

Experiment with whether the L or R channel alone has the right timbre for you, or can be tweaked with eq.  The R channel of the CP50 sounds best to me, but it makes the right side of the keyboard louder (these strings were closer to the mic when the samples were recorded).  This can be compensated, sort of, by judicious eq, but this unavoidably alters timbre as well.

4. Use only the L/MONO out but with reverb…

…and lots of it.  It needs to be the piano’s on-board reverb, so it gets applied before L+R summing at the output.  A long reverb will decorrelate L+R channels (much as playing in wide stereo will) so the comb filtering gets smeared out.  On my CP50 the demo songs are all recorded with a laughably long reverb tail, presumably so they sound good in mono in the store — as indeed they did.

You might get away with a long reverb if you’re playing solo piano.  Otherwise, you need to find the right compromise between reverb and timbre.  In ensembles I prefer to play dry (no reverb) so that the room adds the same ambience to my piano that it does to the other instruments.

5. Allpass filters.

At a given frequency the L/R relative phase depends on which piano string is producing that tone, so it won’t be possible to use a single delay and/or allpass filter to phase-align every harmonic produced by every string on the piano.  It’s a whack-a-mole sort of thing, where aligning phases for one string will inevitably mess up the alignment on the samples for other strings.

But it should be possible to use an allpass to bring just the fundamentals into phase for every note.  (There are DAW plugins and outboard boxes that try to do this automatically in real time.  I don’t know how well they work.)  I haven’t tried this yet.  A strong fundamental is part of my preferred piano timbre, so it might just work.  I’ll add edits here when I’ve had time to experiment.

This approach would alter the R/L phase alignment of all the 2nd- and higher-order harmonics — hopefully no worse than is already the case.  Or a compromise between 1st- and 2nd-harmonic phase alignment might be possible, so that neither has too much phase between channels (if not for every note on the keyboard then at least for most).  From the phase responses shown above, a workable 3-way compromise between phases of the first three harmonics looks unlikely.

Note that with this treatment, non-piano voices may end up sounding comb-filtered if phase-correcting the piano samples requires aggressive L/R phase eq.

6. Parametric eq.

At the most offensive frequencies (where destructive interference causes one or more important harmonics to drop out), high-Q parametric filters could be used to surgically remove a spectral component from one channel while boosting it in the other.  This would prevent or limit destructive interference when L+R are summed to mono.

7. Decorrelation filter.

It may be possible to use a filter that randomizes the phases of one or both channels, decorrelating the signals before they are summed to mono.  The mono signal will end up being densely comb filtered, much as occurs naturally in environments with lots of diffuse reflections.  This does the same job as reverb, but without the reverb; in fact a light reverb could be used for further decorrelation before summing to mono.

This approach, if it works, wouldn’t interfere with non-piano voices.  I’ll edit here when I’ve had time to experiment…

2 thoughts on “Digital Piano Reproduction: Phase Issues 1

  1. Any specific recommendations for a Yamaha P-105? I bought one for my kids to learn on and I am really enjoying it. The built in speakers are very good to my ears. I suspect they are custom tailored for that reason. Headphones are pretty good. But thru a PA it’s pretty rough. I’ve panned hard left and right in stereo but the timbre is still not soft the way I like. Admittedly I’m just getting into experimentation so there are many things I haven’t tried yet. I don’t mind running mono at all for the scattered live thing I do. Is it possible that the P-105 just does’t have the innards to produce a good sound thru line out? I’ve seen a few YouTube videos that sound very nice and are obviously lined out. Any help would be appreciated!

    Great site, BTW. Will be checking back often!

    • I haven’t tried that model, but no reason to expect its samples to be recorded differently than their others. I suspect the built-in speakers sound good because they mimic headphones: speakers in the near-field, with wide angular separation and your head in between. This minimizes the acoustical destructive interference at each ear, which otherwise mangles the sound in the usual PA setup, i.e. speakers facing the listener at a narrower angle.

      I very much doubt the line-out innards are a problem, other than the foolish L+R summing that happens if you plug into only the L/MONO jack.

      I agree, lack of “softness” is the way I describe the timbre when I play live in stereo. I attribute this to a suppressed fundamental (due to destructive interference) but I’m not certain.

      For live gigs my best advice (so far) is one of the following:
      (1) Take output from the Right line-out only; copy it to L and R outputs of the PA (i.e. dual mono).
      (2) Output in stereo, panned hard-left and -right, with speakers separated as far as possible. Try turning one cabinet 90 degrees from the audience, so its output blends with the reverberant field, not the direct sound.

      I’m working hard on other solutions, so check back here. And please let me know how your experiments go!

Leave a Reply

Your email address will not be published. Required fields are marked *