derrick_chi
Junior Member level 3
Hi All
I am having a problem with a DAC and I need a little help. I am attempting to stream audio from an iPhone via Bluetooth. I have an FPGA connected to the Bluetooth chip via an I2S interface, so as the audio comes in I am passing it along to the Delta Sigma DAC and from there of course out to an audio jack. The audio data is 16bits signed twos complement data, the however DAC expects an unsigned input so I am complementing all negative number before I pass them along to the DAC. The DAC is being updated at 44.1kHz. Still the music coming out the speakers sounds really bad, the voices sound robotic, there is loads of static as well. Any idea as to what the problem might be?
Data Flow Description: New samples are applied to the DAC inputs at 44.1kHz, , the previous sample is left on the input until the new sample arrives. The DAC is summing the entire time.
** A little note on the DAC
I am having a problem with a DAC and I need a little help. I am attempting to stream audio from an iPhone via Bluetooth. I have an FPGA connected to the Bluetooth chip via an I2S interface, so as the audio comes in I am passing it along to the Delta Sigma DAC and from there of course out to an audio jack. The audio data is 16bits signed twos complement data, the however DAC expects an unsigned input so I am complementing all negative number before I pass them along to the DAC. The DAC is being updated at 44.1kHz. Still the music coming out the speakers sounds really bad, the voices sound robotic, there is loads of static as well. Any idea as to what the problem might be?
- FPGA:Spartan 6
- DAC CLK Freq: 300Mhz
- Bit Width: 16bits
- Sample Rate 44.1kHz
Data Flow Description: New samples are applied to the DAC inputs at 44.1kHz, , the previous sample is left on the input until the new sample arrives. The DAC is summing the entire time.
** A little note on the DAC
The inputs to the Delta adder are unsigned, the outputs of both adders are considered signed
numbers. The Delta Adder calculates the difference between the DAC input and the current DAC output, represented as a binary number. Since the DAC output is a single bit, it is “all or nothing”; i.e., either all zeroes or all ones.
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ‘timescale 100 ps / 10 ps ‘define MSBI 7 // Most significant Bit of DAC input //This is a Delta-Sigma Digital to Analog Converter module dac(DACout, DACin, Clk, Reset); output DACout; // This is the average output that feeds low pass filter reg DACout; // for optimum performance, ensure that this ff is in IOB input [‘MSBI:0] DACin; // DAC input (excess 2**MSBI) input Clk; input Reset; reg [‘MSBI+2:0] DeltaAdder; // Output of Delta adder reg [‘MSBI+2:0] SigmaAdder; // Output of Sigma adder reg [‘MSBI+2:0] SigmaLatch; // Latches output of Sigma adder reg [‘MSBI+2:0] DeltaB; // B input of Delta adder always @(SigmaLatch) DeltaB = {SigmaLatch[‘MSBI+2], SigmaLatch[‘MSBI+2]} << (‘MSBI+1); always @(DACin or DeltaB) DeltaAdder = DACin + DeltaB; always @(DeltaAdder or SigmaLatch) SigmaAdder = DeltaAdder + SigmaLatch; always @(posedge Clk or posedge Reset) begin if(Reset) begin SigmaLatch <= #1 1’bl << (‘MSBI+1); DACout <= #1 1‘b0; end else begin SigmaLatch <== #1 SigmaAdder; DACout <= #1 SigmaLatch[‘MSBI+2]; end end endmodule