24小时热门版块排行榜    

查看: 1892  |  回复: 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的回帖

大海之星

铁虫 (初入文坛)

引用回帖:
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的回帖
查看全部 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完整的文件名

,,,,,,,,,,,
5楼2012-04-22 14:45:51
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考博] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 Qj98d49dHFb9 2026-08-25 5/250 2026-08-26 04:57 by cNXvBfCpiZOM
[考研] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 7K1CJE38xLG4 2026-08-25 4/200 2026-08-26 02:04 by cNXvBfCpiZOM
[论文投稿] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 7K1CJE38xLG4 2026-08-25 4/200 2026-08-26 02:04 by cNXvBfCpiZOM
[基金申请] 2026年8月25日国自然放榜前突然收到列入评审专家邮件,有关系吗? +17 木水思豆 2026-08-25 20/1000 2026-08-26 01:26 by chengyan1220
[基金申请] 在坚冰还盖着北海的时候,我看到了怒放的梅花。 (金币+10) +6 ziyangfang 2026-08-25 9/450 2026-08-25 20:26 by huagongfeihu
[基金申请] 明天应该可查了!? +6 chengyan1220 2026-08-23 6/300 2026-08-25 19:45 by zfd97
[基金申请] 放榜前的不淡定 20+4 snowwithsea 2026-08-19 19/950 2026-08-25 17:57 by chick875
[基金申请] 某些机构,以效率低为荣,以效率低作为存在感 +9 yuleib84 2026-08-25 10/500 2026-08-25 17:14 by alexon
[基金申请] 如果此刻你正在为国基感到焦虑,不妨来听听这首《基金之外》 +8 scalable 2026-08-24 8/400 2026-08-25 12:52 by jnhyjjm
[基金申请] 人气不行了 +11 fansofjerry 2026-08-21 11/550 2026-08-25 11:04 by 孤独的英雄6
[教师之家] 导师吐槽:我怎么摊上了这么个极品研究生! +3 苏东坡二世 2026-08-23 3/150 2026-08-25 10:35 by shisan1313
[基金申请] 2026年的国家社科基金项目通讯评审的新规则与新动向、新挑战 +5 process2012 2026-08-23 7/350 2026-08-25 09:42 by huixian257
[基金申请] 能否退出参与的面上项目解除限项 +21 koalala 2026-08-24 24/1200 2026-08-24 19:25 by 家与远方
[基金申请] filecode,4个jtjc了 +14 ziyangfang 2026-08-19 17/850 2026-08-24 18:37 by 哈哈蛤?
[教师之家] 跳槽后在研项目怎么办? +5 简单化xn 2026-08-22 10/500 2026-08-23 12:38 by 简单化xn
[基金申请] 今天放榜吗? +15 布布和一二 2026-08-19 16/800 2026-08-23 09:55 by 张春生
[基金申请] 时间戳今天,20号变了 +5 archvillain 2026-08-20 5/250 2026-08-22 06:12 by hui_daxiao
[基金申请] 时间戳又变了 +13 wuchongjun 2026-08-20 19/950 2026-08-21 17:21 by 紫杉醇
[基金申请] 今天放榜没戏了吧 +9 yuleib84 2026-08-19 11/550 2026-08-21 10:06 by gltch
[基金申请] 基金啊基金 +4 longfie172 2026-08-20 4/200 2026-08-21 08:58 by mark mao
信息提示
请填处理意见