完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
你好,我正在尝试使用PIC32 MZ的DSP库。我已经阅读了这个例子并复制了代码,但是在过滤器之后,我收到了所有的1位。请帮助。
以上来自于百度翻译 以下为原文 Hi, I'm trying to use the DSP libraries for Pic32MZ. I've read in the example and copied the code but after the filter I receive all 1bits. // HIGHPASS - 500Hz Fs, 1Hz Fc #define HIGH_PASS_1_B0 0x3F6F0F23 #define HIGH_PASS_1_B1 0x8121E1BA #define HIGH_PASS_1_B2 0x3F6F0F23 #define HIGH_PASS_1_A0 0x812329FA #define HIGH_PASS_1_A1 0x3EDF6685 PARM_EQUAL_FILTER_32 *ptrFilt; PARM_EQUAL_FILTER_32 Filter; void initFilter() { ptrFilt = &Filter; ptrFilt->Z[0]=0; ptrFilt->Z[1]=0; ptrFilt->b[0]=HIGH_PASS_1_B0; ptrFilt->b[1]=HIGH_PASS_1_B1; ptrFilt->b[2]=HIGH_PASS_1_B2; ptrFilt->a[0]=HIGH_PASS_1_A0; ptrFilt->a[1]=HIGH_PASS_1_A1; } int filterItz(int32_t value,int CHANNEL) { int32_t DataOut32; DataOut32 = DSP_FilterIIRBQ32(value, ptrFilt); return DataOut32; } Please help. |
|
相关推荐
1个回答
|
|
|
你好,你的例子不是很完整,但是我只能看到一个关头。你使用int类型作为返回类型,虽然函数实际上是浮点逼近。我不知道如果这个翻译会引起问题…但我倾向于避免这样做。我不能查看您的过滤器设计,但是为了测试库的目的,我建议您使用LP示例(和COEF)。在你进入你自己的过滤器设计团队之前,至少要解决任何性能/功能问题。我们不太理解你对“1BIT”的评论,请详细说明你所观察到的内容。
以上来自于百度翻译 以下为原文 Hello, Your example is not very complete, but I can only see one concern right off the bat. You are using type INT as the return type, although the function is actually a floating point approximation. I do not know immediately if this translation will cause a problem... but I tended to avoid that. I cannot look at your filter design, but for the purposes of testing the library I might suggest you use the LP example (and coefs) provided. At least that is common ground to resolve any performance / functional questions before you move into your own filter design coefs. I do not quite understand your comments about '1bit', please elaborate on what you are observing more. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
508 浏览 0 评论
5813 浏览 9 评论
2351 浏览 8 评论
2238 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3545 浏览 3 评论
1166浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1122浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
890浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
508浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-15 17:48 , Processed in 1.780239 second(s), Total 73, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1508