Open Theremin v3 - bad sound

Posted: 8/21/2020 6:38:07 PM
Bayaneer

Joined: 8/20/2020


Maybe it worth posting a sound sample / video with 1st Timbre if it is not the case of the 2 videos.

I don`t remember what timbres I used

This is the first timbre:
(70MB!!!)  http://accordion.in.ua/ot/1st_timbre.wav
or mp3: http://accordion.in.ua/ot/1st_timbre.mp3


//When I measure the signal at the theremin`s output, I see a normal sine.
But my computer recorded and outputs this:

Maybe the signal is too loud

Posted: 8/21/2020 9:58:58 PM
Mr_Dham

From: Occitanie

Joined: 3/4/2012

Effectively, it is highly distorted.

Yes, signal from open theremin v3 is very loud. It can overdrive some audio system if you don't  care about input gain.

It worth trying an attenuation of open theremin output. (Maybe a 10KH potententiometer would do for the test...)


Posted: 8/22/2020 8:08:43 AM
Mr_Dham

From: Occitanie

Joined: 3/4/2012

Listening to your samples this morning, if I ignore distortion, maybe is it not so bad...

When you have removed distortion. Please Post another sound sample (1st Timbre).
Then we can analyse remaining sound wow in the lower register, aliasing, ...

Posted: 8/22/2020 11:18:36 AM
Thierry

From: Colmar, France

Joined: 12/31/2007

Attenuation of the signal will not solve the problem. Looks like something is heavily hard clipping the signal and we should find out from where that comes, first. To exclude all problems on the code and digital side, could you look at the signal directly at the analog, yet unfiltered output of the DAC and take a picture of the oscilloscope from there?

Posted: 8/22/2020 3:40:53 PM
Bayaneer

Joined: 8/20/2020

Attenuation of the signal will not solve the problem. Looks like something is heavily hard clipping the signal and we should find out from where that comes, first. To exclude all problems on the code and digital side, could you look at the signal directly at the analog, yet unfiltered output of the DAC and take a picture of the oscilloscope from there?

This is the signal from 8th pin of 4921 DAC

Medium register:

Lower register:

Posted: 8/22/2020 5:20:02 PM
Thierry

From: Colmar, France

Joined: 12/31/2007

The first picture, the medium register at almost full volume shows already that the DAC is correctly driven on the digital side. Thus, the clipping which you observe does definitively happen afterwards in the analog section. That is the first problem which you’ll have to solve, because the other small problems can only be correctly identified when the main cause of that horrible distortion will be eliminated.
Why don’t you simply track that beautiful middle register sine wave at full volume which is ok at pin8 of the DAC and look at the following “strategic” points like after the low pass filter (pins 3 and 5 of U8) and after the buffer (pins 1,2,6,7 of U8) and finally after the DC blocking C29 ? Either the sine will be degraded on that way, then there is a problem with your circuit or the double OP amp U8 (does it get power supply on pins 8 vs 4 ?) or you’ll find that the shield works correctly, outputs a nice sine wave and it’s your external amplifier which degrades the signal.
Unfortunately, you didn’t tell more details about your setup. The output level of the open.theremin is a little more than 1V RMS which would naturally overdrive the microphone input of an amplifier or sound card with a sensitivity of only 20 or 50mV. The open.theremin has to be connected to a line level input of an active speaker or a music instrument (keyboard) amplifier. In my workshop, I use a Bose L1 system for testing, voicing, and playing all sorts of Theremins. But that’s something obvious for an experienced engineer and there should be no need to mention it here.

Posted: 8/26/2020 9:33:39 AM
Mr_Dham

From: Occitanie

Joined: 3/4/2012

Hi,

Just curious,


//When I measure the signal at the theremin`s output, I see a normal sine.But my computer recorded and outputs this:[highly cliped signal picture]


I understand from it that the ouput seems to be correct. So, as per Thierry's answer, the problem seem to be at the amplifier side. Don't you have a better amplifier than your computer ? Did you get some intersting result ?

Just curious if you can get a "normal sound". 
(Anyway, probably we can't avoid a few aliasing with the arduino)

Posted: 8/26/2020 1:11:36 PM
Thierry

From: Colmar, France

Joined: 12/31/2007

As I wrote before: "There can be few mellow aliasing ghost tones in the highest register setting, but only in the very highest octave of the 5 octave playing range."

That's an inherent problem in single wavetable based sound generation systems in combination with relatively low sampling rates. It's related to the Mickey Mouse effect. The waveform and thus its slew rate and all harmonics are transposed up and down the pitch scale without respect for the Nyquist frequency. Thus, a 7th harmonic which is ok at 1kHz will generate a ghost tone of 10.25kHz when playing the same waveform roughly 1.5 octaves higher, at 3kHz.

I'm aware of this problem and I tried to implement some at least elementary digital filtering and/or slew rate limiting in the open.theremin firmware, but without success. The old asthmatic 8bit Arduino UNO is not a DSP and extending the dynamic range for the Audio HD version was already pushing the limits...

Posted: 8/26/2020 7:35:04 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I'm aware of this problem and I tried to implement some at least elementary digital filtering and/or slew rate limiting in the open.theremin firmware, but without success."  - Thierry

I'm sure you're quite knowledgeable of the mechanism that generates aliasing.  For me, it was very difficult to believe that the very act of naively making a digital waveform caused aliasing that couldn't then be filtered or slew limited away; that waveforms have to be methodically constructed to minimize it.  I understand that now, but it's really counter-intuitive.

Posted: 8/26/2020 8:35:01 PM
Mr_Dham

From: Occitanie

Joined: 3/4/2012


Unfortunately, it is true that remain a very few number of CPU cycles to do this filtering in real time between two sample sent to the DAC.

I went to same conclusion when I decided to implement MIDI and somewhat externalize the solution for this problem...


A friend of mine submitted another idea: maybe porting on a "nucleo stm32F4" with the same shield would allow some filtering but that's another story.

You must be logged in to post a reply. Please log in or register for a new account.