Digital audio input for a a digital class D amplifier

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hello,

I am building a closed loop digital class D amplifier for a college project. The input to the class D must come from a digital source. The digital input first goes through some digital filtering on FPGA. The digital filter accept 24bit data at 768kHz.

Could anyone suggest how to obtain a digital audio input and feed to the fpga?

Thanks and regards,
asenapati
 
I always laugh when I see people trying to take a "digital signal" farther down the chain, as if you are saving the world from a terrible fate: a D-to-A conversion.

Conceptually you MUST convert to the analog domain SOMEWHERE. The loudspeaker driver expects to see an analog signal and it most happy getting fed that kind of diet. What are the problems with a DAC feeding an analog amplifier that a "digital amplifier" (digital input, yet analog output) is solving? I'm very curious to know of any.
 
Class D is more like pulse width modulation than frequency modulation. Anyway, we are all agreed that Class D is firmly analogue.

Frequency (analog audio signal) is actually applied to generate the square pulses of a:

1. constant amplitude, but varying period - this determines the frequency

and

2. constant amplitude but varying ON and OFF duration - this determines the volume level

so, PWM is actually a frequency modulation, with a help of comparator that samples the audio signal.

If you put the oscilloscope probe at the output of D-class amplifier, but before a smoothing circuitry, you will realise that class D is in fact a digital amplifier. If you feed it a signal from the signal generator, and start varying the frequency AND amplitude, you will see that the density of the pulse train determines the frequency, and that the ON duration of the pulse train determines the volume.
 
No.

The period/on-off-ratio determines the 'instantaneous' voltage level of the output, not the volume. The frequency of the audio signal varies the rate at which the on-off ratio changes, not the rate at which the pulses come along.

If you look at the raw output of a Class D amplifier (with understanding) you will see that Class D is a switching amplifier (not digital) and that the signal is carried by mark-space ratio (clearly an analogue of the original music signal voltage).
 
You need to understand the PWM first

Connect the oscilloscope to the output of a class D amp - don't look at photos you find on internet - they represent a single frequency snapshot.

Switching a DC between 0 and max V is a digital amplifier.

It takes some time to understand....
 
A digital amplifier would be one which represents signals by using numbers - like a digital computer. An analogue amplifier uses analogues (e.g. voltage, pulse width, frequency) - like an analogue computer.

You are making the common mistake of confusing switching with digital. Digital systems use switching. Switching systems are not necessarily digital.

It takes some time to understand....
 
You need to understand the PWM first

Connect the oscilloscope to the output of a class D amp - don't look at photos you find on internet - they represent a single frequency snapshot.

Switching a DC between 0 and max V is a digital amplifier.

It takes some time to understand....

No it is not. A digital amp is an amp that processes digital info. Classical D processes analog info - voltage, current, time.

Jan
 
An example: I have a digital amp with a gain of three.
I feed it a digital code 01010011; at the output appears the code 11111001 (hope I got that right!).

The actual voltages and currents at the output don't matter in principle; they may even be smaller than at the input, yet it is still an amplifier.

A digital volume control in a DAC is an example of a digital amplifier with a variable gain below 1 if it can only attenuate.

Class D is fed with an analog signal, which is modulated in some form, amplifies it and then demodulates it back to analog in the output filter. No digital in sight, no numbers, just voltages, current, time.

The basic misunderstanding is thinking that switching between two voltage levels somehow makes it digital. Funny how people can get confused.

Jan
 
Last edited:
Interesting discussion. PWM can obviously carry 'numbers', albeit serially. How much of that binary serial aspect though is an accident of technological history? Instead of just 0 and 1, more accurate time differentiation theoretically allows for 0, 1 and 2 states in PWM. It's not obvious why representing numbers as 3, 4 or 65536 states is any less 'digital' than a binary representation.
 

Attachments

  • pwmmodulation_1236701204.jpg
    pwmmodulation_1236701204.jpg
    12.1 KB · Views: 124
Class D amplifiers deal with analog domain only to a point of PWM circuitry where the incoming signal is sampled at high frequency by a comparator that decides if the outgoing signal will be ON or OFF. After that point of comparison, the signal is purely digital, but different from "digital audio" as discussed in realm of DAC's, especially multibit DAC's. As I said, the constant DC voltage is used as a source for mosfets that do the switching as per incoming digital PWM stream.

I suggest you finally accept the necessity of using an oscilloscope to start measuring what I suggested already in this thread, few posts back. While at it, get the tone generator as well and do exactly as I instructed. Class D amplifiers can be had very cheaply as well.

Regards,
Nick
 
Interesting discussion. PWM can obviously carry 'numbers', albeit serially. How much of that binary serial aspect though is an accident of technological history? Instead of just 0 and 1, more accurate time differentiation theoretically allows for 0, 1 and 2 states in PWM. It's not obvious why representing numbers as 3, 4 or 65536 states is any less 'digital' than a binary representation.

I agree that it is partly historical. I once knew I guy who developed a system of 3 value logic rather than binary. The very big advantage at the time (must have been 70-ies) was that with the same number of 'bits' (trits?) you can code much more values. IIRC he called it ternary logic. Of course never got anywhere.

Jan
 
Ex-Moderator
Joined 2002
I always laugh when I see people trying to take a "digital signal" farther down the chain, as if you are saving the world from a terrible fate: a D-to-A conversion.

Conceptually you MUST convert to the analog domain SOMEWHERE. The loudspeaker driver expects to see an analog signal and it most happy getting fed that kind of diet. What are the problems with a DAC feeding an analog amplifier that a "digital amplifier" (digital input, yet analog output) is solving? I'm very curious to know of any.

Simple. It saves from expensive relays/switches for input switching, it saves expensive potentiometers/stepped attenuators for volume control, it saves a conversion step, it saves analog coloration by any of the analog parts in the signal path, it is less power hungry, it saves a DAC, it saves a very good PSU for that DAC, it costs in total just as much as a separate DAC so the amplifier is almost free, it saves from an analog preamp with very good PSU's, it saves from hum and buzz problems, it saves from ground loops, it saves from RF stray in etc. In other words, it saves us from thousands of posts and threads here on diyaudio.com :D

Besides that all sources here are digital anyway so why convert to delicate analog signals to let them get chopped by a (meanwhile standard) class D amplifier ? We can not deny that at least some expensive parts can be omitted and that at least some simplification of the chain has been achieved. Since this technology is automatically coupled to class D/PWM amplifiers we can add that those (in general) have less problems with difficult loads, are less power hungry, have much higher efficiency, are cheaper to produce, it saves from bulky heatsinks, they are smaller and lighter so cheaper to ship from Asia, have smaller carbon foot print etc.

In theory this sounds nice but of course there is no free lunch, we get digital volume control in return which is not ideal. Old large and heavy analog sources made by mechanically skilled manufacturers that used many grams of rare earth metals are now redundant and they are thrown away/recycled....So, nostalgia comes around the corner. Rising prices for the few still existing analog amplifiers, tape decks etc. "My analog stuff is made to last", "I don't like the digital glare", "i want to physically touch my music media" etc. A small incrowd that refuses to comply with newer technology. True individualists that go their own way. All this is added value for analog old stuff ! Win-win situation.

It is cheaper technology so it will "win" anyway. Get used to it: FDA or DDX is here to stay. Embrace it !

(if you are unaware: I am playing the devils advocate here ;) )
 
Last edited:
.. accept the necessity of using an oscilloscope to start measuring what I suggested already in this thread, few posts back. While at it, get the tone generator as well and do exactly as I instructed. Class D amplifiers can be had very cheaply as well.

Regards,
Nick

Come on Nick, we know how those scopes shots look, we've seen them multiple times. But you interprete them wrongly.
Several here have tried to explain why your view is incorrect. It's up to you now to 'get' it. I will not bother you again.

Jan
 
No it is not. A digital amp is an amp that processes digital info. Classical D processes analog info - voltage, current, time.

Jan

Digital amplifier must exist in a parallel universe then. What does it process if not voltage, current and frequency (rate)?

Class D processes exactly the same info as a digital amplifier - constant voltage and constant current values; just higher voltage and higher current.

DC bank is used as a source of DC voltage, that is switched in a purely discrete meaner - the pulses are either ON, or OFF.

Digital amplifier does exactly the same thing.

The source of a signal to be handled by a digital amplifier, and by class D amplifier, are different
 
Come on Nick, we know how those scopes shots look, we've seen them multiple times. But you interprete them wrongly.
Several here have tried to explain why your view is incorrect. It's up to you now to 'get' it. I will not bother you again.

Jan

The post was not intended to you, it was intended to DF96. I believe there's good knowledge base to be capitalized on there, just a bit of empirical measurements are missing.

Nick
 
rdf said:
It's not obvious why representing numbers as 3, 4 or 65536 states is any less 'digital' than a binary representation.
Digital doesn't have to be binary, although it usually is binary. The key thing with Class D is that the pulse width is not a number, but an analogue, and is (usually) continuously variable.

Extreme_Boky said:
After that point of comparison, the signal is purely digital, but different from "digital audio" as discussed in realm of DAC's, especially multibit DAC's.
NO! When will you get it? After the comparator the signal is purely switch-based. In a Class D amplifier it is never digital, because it is never a number.

I suggest you finally accept the necessity of using an oscilloscope to start measuring what I suggested already in this thread, few posts back.
I suggest you finally accept the meaning of words. It is difficult to hold a conversation with someone who has private definitions of words.

Class D processes exactly the same info as a digital amplifier - constant voltage and constant current values; just higher voltage and higher current.
A switch is a switch; common sub-circuits do not imply common meaning. You have it stuck in your mind that switching means digital; it does not. Digital usually means switching, but analogue can use switching too. The issue, as we keep telling you, is how the signal is represented: if numbers then it is digital, if by an analogue (e.g. pulse width) then it is analogue. You do understand the meaning of the term 'analogue'?
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.