" 32位浮点单声道音频"杰克 [英] "32 bit float mono audio" in Jack

查看:517
本文介绍了" 32位浮点单声道音频"杰克的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与杰克玩,我注意到默认的音频输入 JACK_DEFAULT_AUDIO_TYPE 设置为32位浮点单声道音频。

I was playing with Jack, and I noticed that the default audio type JACK_DEFAULT_AUDIO_TYPE is set to "32 bit float mono audio".

我有点困惑:IEEE从3.4E-38到3.4E + 38 32定义位C浮动范围约,我想知道什么是最大和最小的失真的幅度,一个 jack_default_audio_sample_t 可与音频类型持有。例如,如果一些的DSP算法给我的样本范围为[0,1],我怎么能正确地他们和杰克的格式之间进行转换?

I'm a bit confused: IEEE defines 32-bit C float range approximately from 3.4E–38 to 3.4E+38, and I was wondering what is the maximum and minimum "undistorted" amplitude that a jack_default_audio_sample_t can hold with that audio type. For example, if some DSP algorithm gives me samples in the range [0,1], how can I correctly convert between them and Jack's format?

推荐答案

这是常见的做浮点信号处理操作,然后扩展pretty和发送之前投的成绩为16位或24位整数到ADC。实施一个IIR滤波器,例如,在浮点意味着可以减少对系数量化的灵敏度。或者,如果你正在做的FFT,您获得更大的动态范围,浮点计算。

It's pretty common to do signal processing operations in floating point, then scale and cast the results to 16-bit or 24-bit integers before sending them to the ADC. Implementing an IIR filter, for instance, in floating point means you can reduce your sensitivity to coefficient quantization. Or if you're doing FFTs, you get greater dynamic range with floating point calculations.

转换的常用方法是做 x_float = x_int *(1.0 / SHRT_MAX)当数据从ADC进来 y_int = y_float * SHRT_MAX 发送到DAC时,16位codeCS。对于24位codeCS,您需要定义 ADC_MAX =(1 <<;&LT; 24) - 1

The usual way of converting is to do x_float = x_int * (1.0/SHRT_MAX) when the data comes in from the ADC, and y_int = y_float * SHRT_MAX when sending to the DAC, for 16-bit codecs. For 24-bit codecs, you need to define ADC_MAX = (1 << 24) - 1.

在使用JACK的情况下,我猜框架借此转化为你的照顾,所以你应该看到浮点值的范围在+/- 1,并且在同一范围内其反馈值。

In the case of using JACK, I guess the framework takes care of this conversion for you, so you should see floating point values in the range +/-1, and feed it back values in the same range.

这篇关于&QUOT; 32位浮点单声道音频&QUOT;杰克的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆