24小时热门版块排行榜    

查看: 1906  |  回复: 6
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

大海之星

铁虫 (初入文坛)

[求助] 最近用matlab采集数据遇到一个问题,求助!

最近用matlab采集数据遇到一个问题,求助!
不好意思,金币实在太少,,没办法给多,,见谅!

我用的em32 Eigenmike microphone array 采集数据,
采集数据为32通道,采集到的数据保存为wav格式,但是却不能通过matlab读取出来,显示:

我用:
[x,fs,Nbits] =wavread('C:\Documents and Settings\Administrator\桌面\wav\file1')

提示我:
??? Error using ==> wavread at 166
Data compression format (Format #65534) is not supported.


后来我在网上搜了搜,发现有人遇到相同的问题,但是他的回答我不太明白,,请大家帮我看看!

The problem is that the file is not actually "normal PCM data", like they write in the source, but actually in the "exstensible" format (which is 0xfffe) - see WAVE header documentation. Later in the header (as part of the GUID field) it is specified that the PCM is saved in IEEE float format.

Changing the "compression code" to 0x0003 (eg. in a hex editor), you can now read the wav in matlab and it actually looks like a wave file in 4 channels...
A small matlab hack, that does the trick is:

fname='out.wav';f=fopen(fname,'r+'); fseek(f,20,0); fwrite(f,[3 0]); fclose(f); y=wavread(fname);
(overwrite the compression code in the file with one matlab understands before loading it) - you could also just do the open-seek-write-close to a bunch of recorded wav files to fix them... after "fixing" the file it now also works in standards compliant audio players like VLC and not just in windows media player...

Edit: Fixed contents to match the truth rather than my initial guess so noone get's confused and merged in my second post...
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

大海之星

铁虫 (初入文坛)

引用回帖:
6楼: Originally posted by ADIBLACKFIN at 2012-04-24 00:35:46:
建议你调用 voicebox工具箱里面的readwav

wav其实包括很多种格式,根据帧头来定义

倒是你的em32 Eigenmike microphone array 令我很感兴趣

如果可以的话,方便Q联系么?

Q397132405

好的
7楼2012-04-25 12:56:09
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 7 个回答

大海之星

铁虫 (初入文坛)

自顶啊    。。。。
2楼2012-04-21 17:49:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

ustbzwx

木虫 (正式写手)

【答案】应助回帖

感谢参与,应助指数 +1
file1.wav完整的文件名
3楼2012-04-22 09:23:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

大海之星

铁虫 (初入文坛)

引用回帖:
3楼: Originally posted by ustbzwx at 2012-04-22 09:23:46:
file1.wav完整的文件名

不是这个问题啊,,加不加。wav都可以的
4楼2012-04-22 14:36:42
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[公派出国] 售SCI一区文章,我:8O5.5.1.O5.4,科目全,可伽急 +3 4FFAWE8HcgUD 2026-08-29 5/250 2026-08-30 20:41 by hZiFeudZyoGR
[公派出国] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 4FFAWE8HcgUD 2026-08-29 4/200 2026-08-30 20:21 by hZiFeudZyoGR
[考博] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +3 jCd0dEvKHShX 2026-08-29 6/300 2026-08-30 19:13 by hZiFeudZyoGR
[考博] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +4 gy1nBQXYQJqL 2026-08-29 6/300 2026-08-30 18:20 by hZiFeudZyoGR
[公派出国] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +5 gy1nBQXYQJqL 2026-08-29 5/250 2026-08-30 18:07 by hZiFeudZyoGR
[考博] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +4 gy1nBQXYQJqL 2026-08-29 5/250 2026-08-30 17:56 by hZiFeudZyoGR
[公派出国] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +6 gy1nBQXYQJqL 2026-08-29 9/450 2026-08-30 17:56 by hZiFeudZyoGR
[论文投稿] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +5 ASdOkHsho7FD 2026-08-28 6/300 2026-08-30 17:25 by hZiFeudZyoGR
[硕博家园] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +7 ASdOkHsho7FD 2026-08-28 14/700 2026-08-30 17:01 by hZiFeudZyoGR
[找工作] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +4 gy1nBQXYQJqL 2026-08-29 8/400 2026-08-30 12:03 by l0VvVHGBGRLv
[考博] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 ASdOkHsho7FD 2026-08-28 6/300 2026-08-30 11:10 by l0VvVHGBGRLv
[基金申请] 麻烦专家们看看评委们的意见(F口面上) +6 gdd2018 2026-08-28 11/550 2026-08-30 08:58 by 超级无敌华子
[硕博家园] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +6 ASdOkHsho7FD 2026-08-28 11/550 2026-08-30 06:00 by ZPa0EcMwuECS
[基金申请] 国自然评审意见 +13 wangmingqi 2026-08-28 19/950 2026-08-29 10:22 by Poppy1104
[基金申请] 系统查不到 +11 董八千 2026-08-26 11/550 2026-08-28 18:06 by Leogzhya
[基金申请] 我不理解! +15 Edward_pc 2026-08-26 23/1150 2026-08-26 20:34 by zzuzxg
[基金申请] 国合里面能看到了 +7 一怀馨秋 2026-08-26 7/350 2026-08-26 11:23 by zhaosm1982
[基金申请] 系统进不去 +4 yanglien 2026-08-26 5/250 2026-08-26 11:10 by wenfengw83
[基金申请] 今天务委会开完了,明天出结果吗 +19 angus9576 2026-08-25 23/1150 2026-08-26 10:03 by zp519
[基金申请] 在坚冰还盖着北海的时候,我看到了怒放的梅花。 (金币+10) +6 ziyangfang 2026-08-25 9/450 2026-08-25 20:26 by huagongfeihu
信息提示
请填处理意见