24小时热门版块排行榜    

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

ustbzwx

木虫 (正式写手)

【答案】应助回帖

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

大海之星

铁虫 (初入文坛)

自顶啊    。。。。
2楼2012-04-21 17:49:18
已阅   回复此楼   关注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的回帖

大海之星

铁虫 (初入文坛)

引用回帖:
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一区文章,我:8.O.551.O.5.4,科目全,可伽急 +3 PbwVEMK5haaE 2026-08-25 4/200 2026-08-26 03:20 by cNXvBfCpiZOM
[考博] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 Qj98d49dHFb9 2026-08-25 4/200 2026-08-26 03:08 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
[基金申请] 今天务委会开完了,明天出结果吗 +18 angus9576 2026-08-25 22/1100 2026-08-26 00:41 by merchancy
[基金申请] 在坚冰还盖着北海的时候,我看到了怒放的梅花。 (金币+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
[基金申请] 有没有大神帮我看看基金代码 28+4 1234567wang 2026-08-24 10/500 2026-08-25 19:15 by lfy8008
[基金申请] 放榜前的不淡定 20+4 snowwithsea 2026-08-19 19/950 2026-08-25 17:57 by chick875
[基金申请] 没有任何消息-是不是就凉了 +9 图啦图啦 2026-08-24 10/500 2026-08-25 11:59 by 南海小哥
[基金申请] 人气不行了 +11 fansofjerry 2026-08-21 11/550 2026-08-25 11:04 by 孤独的英雄6
[基金申请] 2026年的国家社科基金项目通讯评审的新规则与新动向、新挑战 +5 process2012 2026-08-23 7/350 2026-08-25 09:42 by huixian257
[基金申请] 范进中举一文的中心思想 +7 炎黄贵胄 2026-08-22 8/400 2026-08-25 08:48 by ZJTJZ
[基金申请] 只有每年这种时候来逛逛小木虫 +25 yaoyewhu2008 2026-08-20 27/1350 2026-08-25 08:01 by Equinoxhua
[基金申请] 能否退出参与的面上项目解除限项 +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 哈哈蛤?
[基金申请] 让我中一个面上吧! +13 大萍1987 2026-08-20 16/800 2026-08-24 10:23 by 太傻了
[基金申请] 时间戳今天,20号变了 +5 archvillain 2026-08-20 5/250 2026-08-22 06:12 by hui_daxiao
[基金申请] 应该是下周三26日公布了吧? +4 哈哈蛤? 2026-08-21 4/200 2026-08-21 10:58 by Vivilian
[基金申请] 基金啊基金 +4 longfie172 2026-08-20 4/200 2026-08-21 08:58 by mark mao
信息提示
请填处理意见