完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
我打算播放一个音频如下:1。通过USAT接收先前设置为4100Hz、1通道、16比特、2的WAV文件。设置PWM到4100Hz。占空比从0000变化到FFFF,更高质量3.输出引脚进入滤波器,然后到扬声器。我的问题是,任务只从0x00到0x02d3。如何将范围从万到FFFF扩展到FRQQUPWM=44100?
以上来自于百度翻译 以下为原文 I plan to play an audio as follows: 1. To Receive by USART a wav file previously set to 44100Hz, 1 channel, 16bit. 2. Set PWM to 44100Hz. Duty cycle varies from 0000 to FFFF for Higher quality 3. Output pin enter to a filter then to speaker. My problem is Duty varies only from 0x0000 to 0x02D3. How can I extend the range from 0000 to FFFF to freq_PWM=44100? |
|
相关推荐
19个回答
|
|
|
你是如何设置PWM到4100Hz的?这就需要在2.9 GHz的定时时钟来获得16位分辨率。0到0x2D3意味着你在44100×(0x2D3+1)=31.9MHz,所以很明显的是32 MHz。一旦你做了和,你会发现不可能用32 MHz时钟在44.1kHz处做16位。
以上来自于百度翻译 以下为原文 How did you "Set PWM to 44100Hz" ? That would require a timer clocking at 2.9 GHz to get 16 bit resolution. 0 to 0x2d3 implies you are clocking at 44100 * (0x2D3+1) = 31.9MHz, so plainly 32MHz. Once you do the sums, you will see it's impossible to do 16 bits at 44.1kHz with a 32MHz clock. |
|
|
|
|
|
是的,我是这么认为的。我应该配置什么样的值来获得最高的音频质量?音频的质量可以根据PWM可以工作的最佳质量来配置。
以上来自于百度翻译 以下为原文 Yes, I thought so. What value should I configure the PWM to obtain the highest possible audio quality? The quality of the audio can be configured according to the best quality that the PWM can work. |
|
|
|
|
|
我将开始使用8位PWM,即只输出接收数据的上字节。然后,你可以检查它是如何进行的,可能会增加一点……或者,使用更快的图片。
以上来自于百度翻译 以下为原文 I'd start by using a 8bit pwm, i.e. outputting only the upper byte of the received data. Then you can check how it goes and possibly increase a little bit more... Or, use a faster PIC. |
|
|
|
|
|
OP最好先让他妈妈给他买一个计算器和他的兄弟来教他如何使用它。
以上来自于百度翻译 以下为原文 The OP should better start by asking his mom to buy him a calculator and his brother to teach him how to use it |
|
|
|
|
|
16GHz需要3GHz…12位的160MHz…一个PIC24EP就可以了。在任何情况下,我发现去16位相当无用,除非使用特殊的抗噪声抗失真措施……不,可能PWM运行@ 1/2 FoSC。现在不确定
以上来自于百度翻译 以下为原文 3GHz needed for 16bits... 160MHz for 12bits... a PIC24EP should do. In any case I find quite useless to go 16bits, unless special anti-noise anti-distortion measures are used... Ah no, possibly PWM runs @ 1/2 Fosc. Not sure now |
|
|
|
|
|
我已经尝试了8位PWM,并且音频对于我的需求来说是非常低的质量。我认为:周期=[(pWMXPRH:PWMXPRL + 1)* Prescaler ] /PWMLCHILL,这个公式中的最佳场景是PosiCalor=1,PWMYCHILL=32 MHz,这就是我获得GPWMXPRH:PWMXPRL=0xFFFF,然后周期=2.048毫秒(48·28赫兹),然后在FULL中。A:任务=(PWMXDCH:PWMXDCL -PWMXPHH:PWMxPHL)/(pWMXPRH:pWMXPRL + 1)i可以从0x00到0xFFFF(pWMXPHH:PWMXPHL=0),任务从0%到99.99%……但F=48·28 Hz…但是如果我使用100乘以的集成威廉希尔官方网站
,那么我将有fPWM=488kHZ。一切都是正确的吗?它能起作用吗?
以上来自于百度翻译 以下为原文 I already tried to 8bit pwm and the audio is of very low quality for my needs. I think: Period=[(PWMxPRH:PWMxPRL + 1)*Prescaler] / PWM_clock , the best scenario in this formula is Prescaler=1, PWM_Clock=32MHZ, that's the way I get PWMxPRH:PWMxPRL=0xFFFF, then Period=2.048mS (488.28HZ) then in the formula: Duty=(PWMxDCH:PWMxDCL - PWMxPHH:PWMxPHL) / (PWMxPRH:PWMxPRL + 1) I can use PWMxDCH:PWMxDCL from 0x0000 to 0xFFFF (with PWMxPHH:PWMxPHL=0) and Duty go from 0% to 99.99% ... but f=488.28HZ ... but if I use integrated circuits that multiply by 100 then I will have Fpwm=48.8KHz. Is everything correct? It could work? |
|
|
|
|
|
它似乎不起作用,因为数据必须以更快的频率发送给模块。
以上来自于百度翻译 以下为原文 It seems that it will not work because the data must be sent to the module at a faster frequency. |
|
|
|
|
|
我认为你已经开始注意到高质量的音频不是那么容易做到的!这些都是不同的方法来解决你不能做的事情。重新安排计算不会产生不同的答案。这是“天上馅饼”的一厢情愿。你计划在哪里增加频率?你不能将PWM时钟增加到超过32兆赫。你不能使用任何种类的IC来增加PWM外围设备的波形频率。你所说的IC只是增加了方波的频率。不,你只是试图避免这一事实不能用PIC16来完成。为了获得最大的分辨率,你的采样频率必须是一个整数倍的32兆赫。只要管理31250赫兹(=32兆赫/ 2 ^ 10),你就可以。ULD只做10位PWM。每增加一个分辨率的尝试,都会使采样频率减半。
以上来自于百度翻译 以下为原文 I think you're starting to catch on that high quality audio isn't that easy to do! These are all different ways of working out that you cannot do it. Rearranging the calculations isn't going to produce a different answer. This is "pie in the sky" wishful thinking. Where exactly do you plan to increase the frequency? You can't increase the PWM clock to more than 32MHz. You can't use any sort of IC to increase the frequency of the waveform coming out of the PWM peripheral. The sort of IC's you are talking about just multiply the frequency of square waves. No, you're just trying to avoid the fact that this can't be done with a PIC16. To get maximum resolution, your sampling frequency has to be an integer fraction of 32MHz. Just to manage 31,250 Hz (=32MHz / 2^10), you could only do 10 bit PWM. Every extra bit of resolution you try to add will halve the sampling frequency. |
|
|
|
|
|
我知道,有没有一个模块能播放音频来与PIC连接到高质量?我的PC是[Link=Melto:P4@ 1.8GHz ] Pentiu4@ 1.8GHz [/Link ],那么如何播放音频到16位IF3GHz需要16位?
以上来自于百度翻译 以下为原文 I understand, Is there a module that plays audio to connect with the pic to high quality? My PC is [link=mailto:P4@1.8GHZ]Pentium4@1.8GHZ[/link] then how play audio to 16bits if 3GHz needed for 16bits? |
|
|
|
|
|
PWM不是产生高分辨率音频的好方法。你最好用一个外部的DAC芯片来设计音频。你问“我的电脑是怎么做的?”它不使用PWM。
以上来自于百度翻译 以下为原文 PWM isn't a good way to generate high resolution audio. You'd be better off with an external DAC chip designed for audio use. Are you asking "how does my PC do it?" ? It doesn't use PWM. |
|
|
|
|
|
是的,一个SPI或I2C DAC,我来了。16比特的S/N比将不容易实现,但大约12将是容易的。
以上来自于百度翻译 以下为原文 Yep, an SPI or I2C DAC, I was coming to that. Still 16bits S/N ratio will not be easy to achieve, but some 12 will be easy. |
|
|
|
|
|
SPI或并行。即使在400千赫,I2C也不能够处理16位在44100赫兹。
以上来自于百度翻译 以下为原文 SPI or parallel. Even at 400kHz, I2C isn't going to be able to handle 16 bits at 44100 Hz. |
|
|
|
|
|
|
|
|
|
|
|
超过8位的任何东西都将使用两个字节来传送。:)
以上来自于百度翻译 以下为原文 Anything more than 8 bits is going to use two bytes to transfer it. :) |
|
|
|
|
|
哦,是的,但是IMO 8位音频并不坏。我还记得,在某些情况下,一个12位字的上4位被嵌入到控制字节中……无论如何,是的,一个400 kHz的I2C将不起作用。更好的SPI一
以上来自于百度翻译 以下为原文 oh well, yes but IMO 8bits audio is not so bad. And I also remember that in some cases the upper 4 bits of a 12bit word were embedded into the control byte or so... Anyway yes, a 400KHz I2C won't work. Better an SPI one |
|
|
|
|
|
您可以总结两个8位PWMs,但我不知道这是否符合您的质量要求:HTTP://www. OpenMeScLabs.COM/Surviv/Digalal/PWM-DAC/Dou-PWM威廉希尔官方网站
/但是我将使用PIC24和外部DAC,或者DSPIC与内部DAC一起使用。
以上来自于百度翻译 以下为原文 You can sum two 8-bit PWMs, but I don't know if that will meet your quality requirements: http://www.openmusiclabs.com/learning/digital/pwm-dac/dual-pwm-circuits/ But I would go with a PIC24 and an external DAC, or a dsPIC with an internal DAC. |
|
|
|
|
|
这很聪明!我有这样的感觉,在这几年,但从来没有真正尝试过…
以上来自于百度翻译 以下为原文 This is smart! I had a feeling of doing that, during the years |
|
|
|
|
|
有串行数据音频DAC和编解码器,将做16位转换可用,但是它们需要大约12到15兆赫的数据时钟速率(和相应的数据速率)来实现44 KHz采样率。这不是用PIC16F工作!似乎需要重新思考这个方法……我很好奇,总结两个PWM信号以获得更高的分辨率,如何进行求和?在数字或模拟电平?模拟我会假设。
以上来自于百度翻译 以下为原文 There are serial data audio DACs and codecs that will do 16 bit conversion available however they require data clock rates around 12 to 15 Mhz (and corresponding data rates) to achieve 44khz sample rates. This is not going to work with a pic16F! It seems a rethinking of the approach is needed here.... I am curious about summing two PWM signals to get higher resolution, how would that summing be performed? At digital or analog levels? Analog I would assume. |
|
|
|
|
|
是的,模拟在上面的链接中描述得很好。
以上来自于百度翻译 以下为原文 Yep, analog it's well described in the link above. |
|
|
|
|
只有小组成员才能发言,加入小组>>
5248 浏览 9 评论
2036 浏览 8 评论
1956 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3218 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2264 浏览 5 评论
788浏览 1评论
678浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
608浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
685浏览 0评论
582浏览 0评论
/7
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 23:01 , Processed in 2.555356 second(s), Total 112, Slave 96 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (威廉希尔官方网站 图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
383