Git Product home page Git Product logo

fpga-class-d-amplifier's Introduction

FPGA based Class-D amplifier (by using a multibit sigma-delta converter / noiseshaper)

I realized a high-res audio PWM modulator on a FPGA with I2S audio input and 384 kHz output PWM signal capable of driving a Mosfet power-stage to build up a Class-D amplifier or an audio-DAC (with RC filter behind the digital pins).
The whole system runs on a 25 MHz system-clock, the audio-input stream is 96 kHz and the signal is internally upsampled to 384 kHz with an upsampler.

The signal bit-width is reduced to only 5 bits by a multibit sigma-delta (noiseshaper) structure to feed the 5 Bit / 384 kHz audio signal into a PWM generator.

The idea behind the project was to explain how fully digital I2S Class-D amps are working internally (by modulating the PWM signal fully digital directly from the incoming data stream - without any additional analog modulators). This concept is used by many silicon vendors in especially low-power Class-D amplifiers.

The project is based on a TinyFPGA-BX board (iCE40LP8K from Lattice), a Digilent PMOD I2S2 audio adc/dac board (only ADC used), and a board with two MPS MP8040 power half-bridge drivers to drive the loudspeaker.

Before you start - please read the documentation carefully to understand how the whole system is working or just watch my YouTube video where I explained everything in detail with some real audio-tests https://youtu.be/3Jd_ZyCZeGk

Following pinout is used:

PIN24 - ADC-MCLK
PIN23 - ADC-BCLK
PIN22 - ADC-LR
PIN21 - ADC-DATA
PIN18 - PWM out inverted (PWM_n)
PIN17 - PWM out normal phase (PWM_P)
PIN16 - gain[0]
PIN15 - gain[1]
PIN14 - NoiseShaper Bypass-Control

Gain = "00" -> Gain = +0dB
Gain = "01" -> Gain = +3dB
Gain = "10" -> Gain = +6dB
Gain = "11" -> Gain = +9 dB

PIN 14 = "1" -> Noise-Shaper is active
PIN 14 = "0" -> Noise-Shaper is bypassed

System

fpga-class-d-amplifier's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fpga-class-d-amplifier's Issues

Error: Module "main_pll" Issues with synthesizing code proceeding forward

Hello I cloned your repo in the attempts to getting it to work on an Altera 4 development board having the error specifically about the Module main_pll. I bought a lattice board that you had in the video and attempted to get it to work on the lattice board and as I was Importing the P&R file I received this error "Error: Module main_pll is not a valid primitive. Please check!" could you coach me though this step to getting it onto the board thank you very much.
Screenshot (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.