24小时热门版块排行榜    

查看: 1846  |  回复: 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的回帖
相关版块跳转 我要订阅楼主 大海之星 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 小木虫没落了,除了祈祷帖子,几乎看不到有价值的帖子 +9 botar 2026-07-14 9/450 2026-07-15 14:50 by Vivilian
[基金申请] 会评 +3 无名者登山 2026-07-15 3/150 2026-07-15 14:45 by Vivilian
[基金申请] E口青C会评结束了吗? 60+3 小小书虫c 2026-07-14 7/350 2026-07-15 14:45 by Bowerbird
[基金申请] 生命口C13面上会评时间 +6 luckinging 2026-07-14 9/450 2026-07-15 14:39 by 雨冰共舞
[教师之家] 内心匮乏 +13 水冰月月野兔 2026-07-12 13/650 2026-07-15 14:21 by jiduquegai
[文学芳草园] 你可曾有过这种感受? +3 Jeanya 2026-07-09 6/300 2026-07-15 11:07 by mbtwt
[论文投稿] 农业机械学报投稿周期 +3 G0DLIN 2026-07-14 7/350 2026-07-15 09:26 by xs74101122
[基金申请] 国自然面上D口祈祷 +4 monkeynana 2026-07-14 4/200 2026-07-15 09:14 by 白水煮
[论文投稿] 跨出版社商投稿 20+4 倪好520 2026-07-13 4/200 2026-07-15 08:35 by bobvan
[基金申请] 没收到消息,再次陪跑 +3 天空星辰fly 2026-07-14 3/150 2026-07-14 19:14 by 6543yes
[基金申请] E口会评 +8 布布和一二 2026-07-13 10/500 2026-07-14 18:17 by 旋风马1987
[基金申请] 不要再数国自然申请书的 filecode 的分隔符个数了 +13 sadpencil 2026-07-12 20/1000 2026-07-14 13:12 by 杠就是你对
[基金申请] 明天E口面上会评 +8 布布和一二 2026-07-12 9/450 2026-07-13 22:59 by QTSorange
[基金申请] 祈祷青基必中 50+6 hadengry 2026-07-09 16/800 2026-07-12 20:31 by 登山虫虫
[考博] 27届辽宁大学应届毕业生申博 +3 可乐微风大海 2026-07-09 3/150 2026-07-10 21:23 by 贪玩的研究僧
[基金申请] 关于如何从代码看上不上会 +17 且听虎啸 2026-07-09 23/1150 2026-07-10 19:51 by sdfapple719
[有机交流] chemdraw 20+5 ?慕鱼? 2026-07-08 6/300 2026-07-10 15:37 by 紫枫星域
[基金申请] b口会评 +6 当空照 2026-07-08 6/300 2026-07-09 20:49 by tonyliu0401
[考研] 在职考研 +6 wu5d 2026-07-08 7/350 2026-07-09 16:40 by 化工小霸王呀
[基金申请] 化学口会评?应用基础研究和基础研究,希望能分开 +3 Tide man 2026-07-08 3/150 2026-07-09 11:36 by dede5556
信息提示
请填处理意见