This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TLV320AIC3268:系数加载、第2部分

Guru**** 2535150 points
Other Parts Discussed in Thread: TLV320AIC3268

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1009219/tlv320aic3268-coefficient-loading-part-2

器件型号:TLV320AIC3268

尊敬的 TI 专业人士:

好的。 我现在有了我的系数、它们看起来非常好。 现在、是时候上传了。 我一直在阅读该文档 SLAA447、这对我非常有帮助。  当使用 PPS 时、它告诉我我的第一个双二阶实例系数被载入位置簿80 (0x50)、第1页(0x01)和起始寄存器76 (0x4C)。  首先、查看 PPS (参见下图)、数字显示为3.23格式。 SLAA447表示应为1.15数据格式。 其次、寄存器设置中的数据似乎与 PPS 中显示的 Inst1_B0..Inst1A2值不匹配。 这是因为我们设置的数据是 N0、N1、N2、D1和 D2吗?

还有一个问题。 以下是读取这些值所需的基本序列:
 宽30 00
 宽30 7F 50
 宽30 00 01
  R 30 4C      (返回 N0、MSB 的值)
  R 30 4D      (返回 N0、LSB 的值)
  (笑声)

感谢你的帮助。

Phil

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    到目前为止、我的代码是:

    void SetLowPass(unsigned int freq)
    {
    	double Fs = 48000;					// Sample Frequency
    	double f0 = freq;					// Corner frequency (provided input)
    	double dBGain = 0;					// Gain applied to frequencies within range
    	double Q = 0.707;					// Quality constant. 0.707
    	double w0, alpha, sinW, cosW;		// Intermediate calculated parameters
    	double b0, b1, b2, a0, a1, a2;		// Calculated BiQuad Coefficients
    	double B0, B1, B2, A1, A2;			// Normalized BiQuad Coefficients
    	double B0new, B1new, B2new;			// Scaled Coefficients so N0, N1, and N2 are less than 1
    	double N0, N1, N2, D1, D2;			// Calculated Continuous Coefficients
    	double Mx;							// Absolute Maximum Value of 3 Coefficients
    	unsigned char NB = 16;				// Number of Databits of Coefficients
    	unsigned char Range;
    	short N0_1Dot15, N1_1Dot15, N2_1Dot15;	// N0..N2 Conversion to 1.15 Format
    	short D1_1Dot15, D2_1Dot15;				// D1 and D2 Conversion to 1.15 Format
    
    	// Calculate intermediate Parameters
    	w0 = 2*PI*f0/Fs;
    	cosW = cos(w0);
    	sinW = sin(w0);
    	alpha = sinW/(2*Q);
    
    	// Calculate Low Pass Filter Coefficients
    	b0 = pow(10,(dBGain/20))*((1 - cosW)/2);
    	b1 = pow(10,(dBGain/20))*(1 - cosW);
    	b2 = pow(10,(dBGain/20))*((1 - cosW)/2);
    	a0 = 1 + alpha;
    	a1 = -2*cosW;
    	a2 = (1-alpha);
    
    	// Normalize so that A0 = 1
    	B0 = b0/a0;
    	B1 = b1/(2*a0);
    	B2 = b2/a0;
    	A1 = a1/(-2*a0);
    	A2 = a2/(-a0);
    
    	// Scale Coefficients for Normalized largest of values is less than 1
    	Mx = Maxf(B0, B1, B2);
    	if (Mx > 1.0)
    	{
    		B0new = B0/Mx;
    		B1new = B1/Mx;
    		B2new = B2/Mx;
    	} else
    	{
    		B0new = B0;
    		B1new = B1;
    		B2new = B2;
    	}
    
    	// Convert Scaled Continuous Coefficients to Quantized Coefficients
    	Range = 2^(NB-1)-1;
    
    	N0 = floor(B0new*Range);
    	N1 = floor(B1new*Range);
    	N2 = floor(B2new*Range);
    	D1 = floor(A1*Range);
    	D2 = floor(A2*Range);
    
    	// Convert N0-D2 into 1.15 Format Integers (required data format TLV320AIC3268 DSP coefficients
    	N0_1Dot15 = Floatto115(N0);
    	N1_1Dot15 = Floatto115(N1);
    	N2_1Dot15 = Floatto115(N2);
    	D1_1Dot15 = Floatto115(D1);
    	D2_1Dot15 = Floatto115(D2);
    
        // Now, upload these new coefficients into the DSP at the location of the Low Bandpass BiQuad Instance.
    
    	// Begin by setting DSP into Adaptive Filtering for DAC (DAC won't accept the new changes otherwise)
    
    
    }

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    校正。

    第54行: 范围= pow (2、(NB-1))- 1;

    在 MATLAB 中、^符号将 x 提高到 y 幂(指数)。 在 C 语言中、这是一个逻辑按位异或。 非常不同。 必须使用 pow()函数。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    顺便提一下、与 SLAA447中的样本相比、我获得了合适的低带滤波器系数。 我唯一的问题是如何知道寄存器位置。  由於我使用缴费灵来配置双二阶,我怀疑我需要留意缴费灵所说的我们应该设置参数的地方。 SLAA447指出、这些系数应采用1.15格式。 从上面的 PPS 屏幕截图可以看出、系数采用3.23格式。 PPS 是否重新计算上传的 N0、N1、N2、D1和 D2值中的 b0、B1、B2、A1、A2值?  这是我看到的吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    由于我正在使用 DAC、是否在 TLV320AIC3268中尚未启用自适应滤波?  我是否仍需要在第8页上设置自适应滤波模式?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    如果我们使用自适应滤波、是否应该没有两组缓冲器?  第二个黄油的地址是什么?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    只是注意到了这种差异。  请参见下图。 一个是文档 SLAA447、另一个是 SLAS953A (TLV320AIC3268数据表)。 数据表中的传递函数使用24位3字节数据字;更像是1.23数据格式。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Phil、

    我认为您参考的应用手册仍然有用、但它没有为 AIC3268明确编写。 某些 miniDSP 器件具有16位 DSP、而 AIC3268具有24位 DSP。 听起来您已经知道了这一点、但很抱歉造成了混乱。 我相信您的寄存器读取序列是可以的。

    可针对 ADC 和 DAC 部分独立启用/禁用自适应滤波模式、具体取决于您编程的滤波器所在的位置。 在 ADC 的第40页寄存器1和 DAC 的第80页寄存器1中启用自适应滤波

    您应该能够直接写入双二阶系数、只需记住、B1和 A1需要是预期值的一半、因为它们在传递函数中被乘以2。

    最棒的

    Zak