24小时热门版块排行榜    

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

大海之星

铁虫 (初入文坛)

自顶啊    。。。。
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的回帖

大海之星

铁虫 (初入文坛)

引用回帖:
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的回帖

ADIBLACKFIN

铁虫 (初入文坛)

【答案】应助回帖

感谢参与,应助指数 +1
建议你调用 voicebox工具箱里面的readwav

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

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

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

Q397132405
6楼2012-04-24 00:35:46
已阅   回复此楼   关注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的回帖
相关版块跳转 我要订阅楼主 大海之星 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 276求调剂 +3 路lyh123 2026-02-28 4/200 2026-02-28 19:45 by 路lyh123
[考博] 博士推荐 +5 花儿笑? 2026-02-21 6/300 2026-02-28 18:53 by nxgogo
[考研] 298求调剂 +6 人间唯你是清欢 2026-02-28 8/400 2026-02-28 18:52 by 人间唯你是清欢
[考研] 311求调剂 +7 南迦720 2026-02-28 7/350 2026-02-28 18:28 by leonnulll
[基金申请] 面上模板改不了页边距吧? +3 ieewxg 2026-02-25 3/150 2026-02-28 18:25 by addressing
[考研] 高分子化学与物理调剂 +4 好好好1233 2026-02-28 5/250 2026-02-28 18:20 by liqiongjy
[教师之家] 版面费该交吗 +15 苹果在哪里 2026-02-22 18/900 2026-02-28 18:20 by mibaomingg
[考研] 285求调剂 +5 满头大汗的学生 2026-02-28 5/250 2026-02-28 18:10 by 材料专硕调剂;
[考研] 材料调剂 +3 爱擦汗的可乐冰 2026-02-28 3/150 2026-02-28 18:06 by houyaoxu
[考研] 化工专硕348,一志愿985求调剂 +3 弗格个 2026-02-28 5/250 2026-02-28 17:04 by sandychj
[高分子] 求环氧树脂研发1名 +3 孙xc 2026-02-25 11/550 2026-02-28 16:57 by ichall
[考研] 265分求调剂不调专业和学校有行学上就 +4 礼堂丁真258 2026-02-28 6/300 2026-02-28 16:18 by 求调剂zz
[考研] 295求调剂 +4 19171856320 2026-02-28 4/200 2026-02-28 13:39 by ms629
[考研] 寻找调剂 +3 LYidhsjabdj 2026-02-28 3/150 2026-02-28 12:59 by miniwendy
[硕博家园] 博士自荐 +6 科研狗111 2026-02-26 9/450 2026-02-28 12:32 by seaskyy
[考研] 272求调剂 +3 田智友 2026-02-28 3/150 2026-02-28 12:31 by 王加浩to
[考研] 298求调剂 +4 axyz3 2026-02-28 4/200 2026-02-28 11:21 by wang_dand
[基金申请] 什么是人一生最重要的? +10 瞬息宇宙 2026-02-21 10/500 2026-02-27 08:46 by tfang
[基金申请] 面上可以超过30页吧? +12 阿拉贡aragon 2026-02-22 13/650 2026-02-26 22:09 by Hahaxia
[硕博家园] 【博士招生】太原理工大学2026化工博士 +4 N1ce_try 2026-02-24 8/400 2026-02-26 08:40 by N1ce_try
信息提示
请填处理意见