The No.1 Website for Pro Audio
 Search This Thread  Search This Forum  Search Reviews  Search Gear Database  Search Gear for sale  Search Gearslutz Go Advanced
Tape emulation waveshaping/transfer function
Old 1 week ago
  #1
Tape emulation waveshaping/transfer function

Hi everyone,

Longtime engineer/producer, n00b with electronics and DSP. I am currently studying an MSc in Digital Audio Engineering (read audio programming and DSP). For one of my assignments, I have chosen to implement a basic tape emulation function in Matlab. As I am at the beginning of my DSP journey I don't want to overcomplicate things and therefore I just want to do something that approximates tape.

I have ran a load of chirps and sines through my own tape machine an Otari MX80 (calibrated to 30 IPS, SM911 tape). I have some plots and can see that the 3rd Harmonic being present without having to drive the tape too hard and closer to hard clipping points I have some 5th and 2nd coming in.

I am going to try and implement a *simple* function, where I will use an FIR filter, based on the impulse response of my tape machine to replicate the frequency response and a waveshaper to replicate the saturation (at this point wow/flutter and other things will take too long so I am just doing something simple).

My question is does anybody know where there might be any research on how to create a waveshaper which would favour 3rd Harmonics? or maybe even a transfer function for tape?
Old 1 week ago
  #2
Lives for gear
Just curious, since I'm definitely not a Simulink-level DSP guy: will your FIR add a distortion that's not part of Otari's actual sound?

-
[And looking to the future. Some day soon, someone will load a big bunch of Otari before/after samples into AWS or similar, and train a neural net to do all this...
Old 1 week ago
  #3
Quote:
Originally Posted by Jay Rose View Post
Just curious, since I'm definitely not a Simulink-level DSP guy: will your FIR add a distortion that's not part of Otari's actual sound?
Neither am I, In fact, Simulink is out of the scope of my course.

The FIR shouldn't be the part adding harmonic distortion that should be the waveshaper part. I am just trying to approximate the harmonic distortion of a tape machine rather than trying to design a specific function to emulate my own tape machine. That would be too difficult for my deadlines and limited knowledge thus far, hence the oversimplification.
Old 1 week ago
  #4
Lives for gear
Phase distortion may be a characteristic of FIR; it depends on how you design it.

See https://dspguru.com/dsp/faqs/fir/properties/
Old 1 week ago
  #5
Lives for gear
 

If you want to design a tape emulator, I suggest you first try out some that are already available. Trying to build one blind without knowing what's already available is pretty silly. Its like building an automobile before you' e ever even seen of driven in one. its makes no sense at all trying to reinvent the wheel after the discovery has already been out there for decades.

There are a bunch of free ones you can start with and then maybe even try some demo versions of ones you'd pay for.
The one Voxengo makes is one of my favorites, but you can simply google up a half dozen including Ferox which is really popular.

next you need to separate what the analog preamplifier does vs what the actual process of magnetizing and reading AC waves on tape.
each have their own unique characteristics in what they do to the sound.

I do know there are emulators which include features that emulate a damaged recorder by including flutter, wow, or head alignment issues.
Really stupid idea if you ask me. Any professional who's worked with tape knows the ideal tape sound is flawless and pristine. Its the kid who digs his grandpas reel recorder that's barely able to run properly that thinks those flaws are the intention of the manufacturer.

Likewise his is a side effect of the high fidelity preamps and the iron oxide particles of the tape. Manufacturers eventually developed Dolby which hides most of the hiss by first encoding the high frequencies, then decoding them on playback. As a result most commercial recordings had no hiss at all by the time it was burned to an LP. Why on earth would anyone want that noise in their recordings is beyond me.

There are frequency response differences based on tape speed, tape types and head types which can be significant. Several of the tape emulators I've used have those features and that come in handy. Emulated recording gain and saturation are key items as are output volume and at least a bass and treble adjustment so you can dial frequencies back for a small sounding, mission impossible recorder type or boost the highs and lows so the response is bigger then life.

What they don't have is a midrange knob which is where the real mojo using tape comes into play. Allot of people who write the software have zero experience using the actually analog tape on a professional and are clueless how tape is used and abuse to get the kinds of magic tones people seek.
What most engineers wanted is a flat full fidelity medium with any unwanted distortions. Their wish actually came true once digital was perfected.

Beyond that however was the ability to push tape in a selective and aggressive manor which wound up being very difficult to accomplish digitally.
The first thing I had a hard time adjusting to when I moves from analog to digital was the ability to tweak input gains to the edge of the cliff, just before the tape began to distort but produces the greatest fidelity, maximum compression and has the liveliest sound being that close to clipping. On top of that you can EQ the input and get specific notes to saturate before other notes begin to. In short the engineer has some control over the notes being played and can amp up the musicians musical performance getting specific notes to jump out at you on a musical and emotional level.

So far I haven't found any of the tape emulators to do that job on their own. Part of the problem is, it isn't occurring before the tracks are recorded and its not occurring from simply placing the music on a medium. What the hard drive sees as binary bits are exactly the same as what comes off the drive.
You can get close using a combination of 5 plugins in various amounts including EQ, Compression, Gain Saturation, Harmonic Exciter and tape emulation.

It really takes most of those plugins to come close to sounding like tape, and the tape emulator plugin isn't always necessary in getting ideal results which just goes to show you that these kinds of plugins simply aren't as good as you'd think in creating a realistic tape sound, but on the other hand what is. If you listened to a recording done on tape and digital then burned to a CD and played back on a radio would you be able to tell which one was recorded on tape or straight digital all the way? I been recording for over 50 years and you wouldn't catch me trying to win that blind A/B comparison. there are far too many ways of making Digital sound analog and analog sound digital. The line between the two is blurred most of the time, especially when you have it all down sampled to MP3's which kills your top end and wipes out anything a tape emulator would do for your music.
Old 1 week ago
  #6
Thanks for your thoughts, really in-depth I think you are making a few assumptions (maybe you skim read my post?), I actually own a lot of tape emulators, UAD, Slate, Softube, Izotope etc. I also own a tape machine (as I mentioned in my post). I am well aware of its sound and history.

All I am really wanting is to do a VERY oversimplified tape emulation for a university assignment (I've just gone back to university part-time after working as an audio engineer/producer for almost 15 years). I am still working on educating myself on analogue electronics, which makes trying to do a "white box" model of analogue gear pretty much impossible. However, I can try a bit of a "gray box" model (ie knowing the input and output and being able to approximate its behaviour).

Quote:
Originally Posted by wrgkmc View Post
If you want to design a tape emulator, I suggest you first try out some that are already available. Trying to build one blind without knowing what's already available is pretty silly. Its like building an automobile before you' e ever even seen of driven in one. its makes no sense at all trying to reinvent the wheel after the discovery has already been out there for decades.

There are a bunch of free ones you can start with and then maybe even try some demo versions of ones you'd pay for.
The one Voxengo makes is one of my favorites, but you can simply google up a half dozen including Ferox which is really popular.

next you need to separate what the analog preamplifier does vs what the actual process of magnetizing and reading AC waves on tape.
each have their own unique characteristics in what they do to the sound.

I do know there are emulators which include features that emulate a damaged recorder by including flutter, wow, or head alignment issues.
Really stupid idea if you ask me. Any professional who's worked with tape knows the ideal tape sound is flawless and pristine. Its the kid who digs his grandpas reel recorder that's barely able to run properly that thinks those flaws are the intention of the manufacturer.

Likewise his is a side effect of the high fidelity preamps and the iron oxide particles of the tape. Manufacturers eventually developed Dolby which hides most of the hiss by first encoding the high frequencies, then decoding them on playback. As a result most commercial recordings had no hiss at all by the time it was burned to an LP. Why on earth would anyone want that noise in their recordings is beyond me.

There are frequency response differences based on tape speed, tape types and head types which can be significant. Several of the tape emulators I've used have those features and that come in handy. Emulated recording gain and saturation are key items as are output volume and at least a bass and treble adjustment so you can dial frequencies back for a small sounding, mission impossible recorder type or boost the highs and lows so the response is bigger then life.

What they don't have is a midrange knob which is where the real mojo using tape comes into play. Allot of people who write the software have zero experience using the actually analog tape on a professional and are clueless how tape is used and abuse to get the kinds of magic tones people seek.
What most engineers wanted is a flat full fidelity medium with any unwanted distortions. Their wish actually came true once digital was perfected.

Beyond that however was the ability to push tape in a selective and aggressive manor which wound up being very difficult to accomplish digitally.
The first thing I had a hard time adjusting to when I moves from analog to digital was the ability to tweak input gains to the edge of the cliff, just before the tape began to distort but produces the greatest fidelity, maximum compression and has the liveliest sound being that close to clipping. On top of that you can EQ the input and get specific notes to saturate before other notes begin to. In short the engineer has some control over the notes being played and can amp up the musicians musical performance getting specific notes to jump out at you on a musical and emotional level.

So far I haven't found any of the tape emulators to do that job on their own. Part of the problem is, it isn't occurring before the tracks are recorded and its not occurring from simply placing the music on a medium. What the hard drive sees as binary bits are exactly the same as what comes off the drive.
You can get close using a combination of 5 plugins in various amounts including EQ, Compression, Gain Saturation, Harmonic Exciter and tape emulation.

It really takes most of those plugins to come close to sounding like tape, and the tape emulator plugin isn't always necessary in getting ideal results which just goes to show you that these kinds of plugins simply aren't as good as you'd think in creating a realistic tape sound, but on the other hand what is. If you listened to a recording done on tape and digital then burned to a CD and played back on a radio would you be able to tell which one was recorded on tape or straight digital all the way? I been recording for over 50 years and you wouldn't catch me trying to win that blind A/B comparison. there are far too many ways of making Digital sound analog and analog sound digital. The line between the two is blurred most of the time, especially when you have it all down sampled to MP3's which kills your top end and wipes out anything a tape emulator would do for your music.
Old 1 week ago
  #7
Lives for gear
Manufacturers eventually developed Dolby which hides most of the hiss by first encoding the high frequencies, then decoding them on playback. As a result most commercial recordings had no hiss at all by the time it was burned to an LP. Why on earth would anyone want that noise in their recordings is beyond me.

Manufacturers didn't develop Dolby. One specific manufacturer -- Dolby Labs -- did. They sold hardware that used four fixed bands of codec to pro users, and licensed a simplified sliding HF-only implementation to various cassette deck makers.

In both setups, the decoder had to be calibrated to the encoder. Pro units (and Advent's standalone consumer processor) had a tone generator, meter, and calibration knob for this purpose. Most cassette decks hardwired the "calibration" and didn't let the user tweak.

It wasn't magic. It relied on masking: Loud signals (when properly calibrated) were passed unchanged, on the theory that they'd hide noise from the tape record/play cycle. But the noise was still there, and could interfere with subtle sounds in nearby bands that weren't being masked. If you looked on a scope, you could see the noise riding even the louder signals. But the ear could ignore it.

Soft signals were boosted, which meant the tape noises would be relatively lower than they'd be for an unboosted signal.

Of course the boosted signals had to be lowered to their original volume on playback (lowering system noise at the same time), and the knee where the system shifted from boost to linear had to be calibrated. Otherwise there'd be odd dynamic effects.

In other words, Dolby at the best of times had its own unique sound. Better than tape hiss, but with other sacrifices that people didn't mind as much. About 20 years after pro Dolby A was released, they came up with Dolby SR. It used four sliding bands for more precise masking.

FWIW, dbx released a single-band codec system that didn't require calibration. Dolby and dbx were not compatible with each other.

Philosophy: Analog Dolby and dbx didn't reduce noise. They relied on both psychoacoustic masking to make noise less noticeable, and temporary boosting to make low signals louder compared to noise. The played back signal wasn't identical to the original, but had modulated noise patterns that folks didn't mind. In other words, analog NR was very similar to what MPEG compression does in the digital domain. Just with a lot fewer bands, and some volume tweaking for the channel rather than digital bit reduction (hide low bit depth noise where you wouldn't hear it) and zip-like compression of the result.

Last edited by Jay Rose; 1 week ago at 05:52 PM.. Reason: typos
Old 6 days ago
  #8
Lives for gear
 
bogosort's Avatar
Quote:
Originally Posted by Dowsed View Post
My question is does anybody know where there might be any research on how to create a waveshaper which would favour 3rd Harmonics? or maybe even a transfer function for tape?
Pure 3rd harmonic distortion is easy with a cubic nonlinearity, which is a simple form of soft-clipping. See the algorithm section of this page for the mathematical details: https://wiki.analog.com/resources/to.../standardcubic

Implement that, with alpha = 1 and x as your input signal, and tweak from there.

Unfortunately, I don't think you'll be able to find an effective transfer function for tape. I'd just play with waveshapers until you get something reasonably close. Good luck and have fun!
Old 3 days ago
  #9
Here for the gear
 

Quote:
Originally Posted by Jay Rose View Post
Manufacturers eventually developed Dolby which hides most of the hiss by first encoding the high frequencies, then decoding them on playback. As a result most commercial recordings had no hiss at all by the time it was burned to an LP. Why on earth would anyone want that noise in their recordings is beyond me.

Manufacturers didn't develop Dolby. One specific manufacturer -- Dolby Labs -- did. They sold hardware that used four fixed bands of codec to pro users, and licensed a simplified sliding HF-only implementation to various cassette deck makers.

In both setups, the decoder had to be calibrated to the encoder. Pro units (and Advent's standalone consumer processor) had a tone generator, meter, and calibration knob for this purpose. Most cassette decks hardwired the "calibration" and didn't let the user tweak.

It wasn't magic. It relied on masking: Loud signals (when properly calibrated) were passed unchanged, on the theory that they'd hide noise from the tape record/play cycle. But the noise was still there, and could interfere with subtle sounds in nearby bands that weren't being masked. If you looked on a scope, you could see the noise riding even the louder signals. But the ear could ignore it.

Soft signals were boosted, which meant the tape noises would be relatively lower than they'd be for an unboosted signal.

Of course the boosted signals had to be lowered to their original volume on playback (lowering system noise at the same time), and the knee where the system shifted from boost to linear had to be calibrated. Otherwise there'd be odd dynamic effects.

In other words, Dolby at the best of times had its own unique sound. Better than tape hiss, but with other sacrifices that people didn't mind as much. About 20 years after pro Dolby A was released, they came up with Dolby SR. It used four sliding bands for more precise masking.

FWIW, dbx released a single-band codec system that didn't require calibration. Dolby and dbx were not compatible with each other.

Philosophy: Analog Dolby and dbx didn't reduce noise. They relied on both psychoacoustic masking to make noise less noticeable, and temporary boosting to make low signals louder compared to noise. The played back signal wasn't identical to the original, but had modulated noise patterns that folks didn't mind. In other words, analog NR was very similar to what MPEG compression does in the digital domain. Just with a lot fewer bands, and some volume tweaking for the channel rather than digital bit reduction (hide low bit depth noise where you wouldn't hear it) and zip-like compression of the result.
I am *just a little bit* of an expert on DolbyA -- actually writing DolbyA compatible decoder that does better than a real DolbyA.

Everything written above about DolbyA is true, but the idea of 'modulated noise patterns' could be taken a step further... DolbyA produced a lot of intermodulation distortion due to the fast gain control. Even in the best of times, the very subtle, ingenius DolbyA compressor design (used in inverse for decoding) still produced a significant amount of IMD -- even after decoding.

When listening to fully decoded material, the IMD was most noticeable at high frequencies -- causing a fuzz or veil (not to be confused with noise modulation directly). Also, certain kinds of complex sharp transients (like cymbals) were blunted. This was due to a few things, but all-in-all the biggest problem were the modulation products produced -- and inability to undo the modulation products during decoding. (It seems like the feedback design also didn't fully undo the dynamics of the encoding -- still looking into that.)

On a 'tilting at windmills' quest - I have written a very precise, much-less-imd DA decoder in software (previously not thought to be possible) -- and it is amazing about the quality improvement... A lot of old recordings are now able to be more completely recovered. (I am NOT touting the decoder, but meaning to describe what happens in the DolbyA encode/decode cycle.)

DolbyA encode/decode does have a 'sound' -- some engineers realized it even back in the 1960s, and using DolbyA was a Faustian bargain (noise vs certain kinds of quality.) There were limits as to what the hardware could do (hilbert transforms and dynamic attack/release filtering were just not practical.) The software version does a LOT of math to stash the modulation products in a way that they occur when least audible (basically, the *unwanted* modulation products are suppressed by doing the modultion at a different time -- tricky stuff.)

Anyway -- too many details...

But, to emulate the sound of professional recording -- using the typical technology of the day -- I'd expect that on average, the DolbyA sound is more impactful than the 'sound' of a tape recorder.

The DolbyA distortion has some similar characteristics as tape distortion -- it tends to soften and blunt the more intense details. A true DolbyA (not my decoder) can leave a veil of intermod that happens coincedental with intense tones (I can show examples). Decoding the material with the distortion removed (that is possible in software), the 'veil' disappears, and all that is left is the dminished tape hiss. (The distortion veil is NOT hiss.)

(I started describing all of the DolbyA distortion characteristics, then realizing that it wouldn't be helpful... So decided not to post unless asked)

Bottom line, a lot of older professional stuff was done with DolbyA. Whatever IMD caused compression that there was due to 'tape', there was even more distortion caused by the 'DolbyA' encode/decode cycle.

A caveat: usually, people will use the artificial 'sounds like' distortions to 'sound good'. Sometimes truly emulating the distortion isn't the best choice -- DolbyA distortion (if you have ever carefully listened to ABBA -- there is significant DolbyA distortion in there) doesn't always sound good -- but it was in a lot of old recordings.




John
Old 3 days ago
  #10
Lives for gear
John, thank you for the info. You're way ahead of me on this stuff.

- FWIW, some engineers (primarily in film post) used the Dolby A decoder as a single-ended NR! You had to be very careful to set levels so that dialog would be preserved but noise would still be downward expanded, but it did provide four bands of independent masking so could be more 'transparent' than a typical noise gate or expander of the time. This was before the Cedar hardware came out.
Old 3 days ago
  #11
Quote:
Originally Posted by bogosort View Post
Pure 3rd harmonic distortion is easy with a cubic nonlinearity, which is a simple form of soft-clipping. See the algorithm section of this page for the mathematical details: https://wiki.analog.com/resources/to.../standardcubic

Implement that, with alpha = 1 and x as your input signal, and tweak from there.

Unfortunately, I don't think you'll be able to find an effective transfer function for tape. I'd just play with waveshapers until you get something reasonably close. Good luck and have fun!
Thank you bogosort. This was exactly what I needed!
Old 3 days ago
  #12
Here for the gear
 

Quote:
Originally Posted by Jay Rose View Post
John, thank you for the info. You're way ahead of me on this stuff.

- FWIW, some engineers (primarily in film post) used the Dolby A decoder as a single-ended NR! You had to be very careful to set levels so that dialog would be preserved but noise would still be downward expanded, but it did provide four bands of independent masking so could be more 'transparent' than a typical noise gate or expander of the time. This was before the Cedar hardware came out.
You are 100% right about possibly using DolbyA decoding as a single ended NR. It CAN work... But, I have definitely made mistakes in the past (might still do it again -- detecting DolbyA material is not reliable) by 'decoding' something that wasn't actually encoded. (My face has been 'red' alot.)

Fairly often, misusing the DolbyA decode mode causes a 'appears from nothing' sound -- sometimes gating, and sometimes over-enhancement of sibilance. After years of experience (actually only about 1month of a truly accurate, clean, fully functioning decoder), I am very gun-shy about 'demos' unless I am VERY VERY sure about the state of the original material. There have been a LOT of mirages in some of my tests/demos.

On the other hand, historically DolbyA units have been used in 'encode' mode as enhancers (like sometimes used on Karen Carpenter.)

The 'interesting' thing about the DolbyA design (IMO) is the attack/release circuitry. It is almost a 'stealth' design... Just looking at the circuit -- ahhh... A simple two layer averaging/peak detector.... bzzzt. I wouldn't be surprised that most of the attempted emulations had misunderstood that circuit... Why do I mention that little detail?

The reason why I mention the detail is that I'd would not be surprised if most people trying to emulate R Dolbys ingenius design would miss some of the very subtle design concepts, and never be able to make a fast compressor (for enhancement) work as well as Mr Ray Genius Dolby. There be some real tricks in that circuit... (At least, tricks for an engineer who overlooks the details.)

If anyone would like a full description of the circuit, first do a quick study of the diode exponential conductivity curve, and notice that Mr Genius had the diodes operating in the exponential conductivity region more than the ON/OFF region. The Dolby guy was a very special engineer... Those two layers of nonlinear attack, and the secondary layer which has a nonlinear release (along with the first layer release time only being active on signals longer than a few msec) - that circuit does pretty amazing things-- it does practically as much as humanly possible with 1960's technology and almost the fewest parts possible to mitigate the natrual modulation distortions happening with fast gain control.

(After getting in the mode to understand the nonlinear behavior of the diodes -- not just the on/off/forward only type thing, then I am 100% willing to go into more detail -- amazing stuff.)

A normal/simple ad-hoc fast compressor (used for enhancement) would sound pretty much like hell when compared with the DolbyA unit. That dynamic soft attack time (which speeds up on big changes) and the dynamic release time -- really good, and I don't understand AT ALL how he actually invented it -- it is a VERY good and efficient detector design.
(The selected components elsewhere suck, but that detector design is really, really cool.)

Bottom line: the DolbyA would have made a nice vocal enhancer -- FOR THE DAY, but of course, not today (we have better things now.)


John

Last edited by John Dyson; 3 days ago at 07:08 PM.. Reason: clarification
Post Reply

Welcome to the Gearslutz Pro Audio Community!

Registration benefits include:
  • The ability to reply to and create new discussions
  • Access to members-only giveaways & competitions
  • Interact with VIP industry experts in our guest Q&As
  • Access to members-only sub forum discussions
  • Access to members-only Chat Room
  • Get INSTANT ACCESS to the world's best private pro audio Classifieds for only USD $20/year
  • Promote your eBay auctions and Reverb.com listings for free
  • Remove this message!
You need an account to post a reply. Create a username and password below and an account will be created and your post entered.


 
 
Slide to join now Processing…
Thread Tools
Search this Thread
Search this Thread:

Advanced Search
Similar Threads
Thread
Thread Starter / Forum
Replies
Reverb / Mastering Forum
31
Tube World / High End
38
cichy / Geekslutz Forum
0
Harsh / So Much Gear, So Little Time
6

Forum Jump
Forum Jump