声使用矩形麦克风阵列波束形成
7视图(30天)
显示旧的评论
使用Mathworks例子:
我复制这段代码使用一个矩形的4 x4数组而不是线性数组。我的头:
模拟接收到的信号
我只是使用一个音频信号x1如何使用阶跃函数?
我试着
temp =一步hCollector, x1, ang_dft +√(noisePwr) *兰德(rs, NSamPerFrame [4
4)));
我收到的错误是:
警告:输入参数必须是标量。
错误使用+
矩阵尺寸必须同意。
错误在文件(47)行
temp =一步hCollector, x1, ang_dft +√(noisePwr) *兰德(rs, NSamPerFrame [4
4)));
我如何正确地执行这个?
这是我的代码:
H = phased.OmnidirectionalMicrophoneElement (“BackBaffled”,真正的)
fc = (200 300 400)
ang = (0, 0);
resp =步骤(H, fc, ang);
plotResponse (H, 200,“RespCut”,“阿兹”,“格式”,“极地”)
哈=分阶段。(4 [4],[0.00635 - 0.00635],“元素”H)
图;
plotResponse(哈,200340,“RespCut”,“3 d”,“格式”,“极地”)
% - - - - - - - - - - - - - - - - - - - - - - - -
ang_dft =[10] -10年
fs = 8000
hCollector = phased.WidebandCollector (“传感器”,哈,“PropagationSpeed”,340,“SampleRate”fs,“ModulatedInput”、假);
t_duration = 3;
t = 0:1 / fs: t_duration / fs;
rs = RandStream.create (“mt19937ar”,“种子”,2008)
noisePwr = 1的军医
% preallocate
NSamPerFrame = 1000
NTSample = t_duration * fs
sigArray = 0 (NTSample 4 [4])
voice_dft = 0 (NTSample, 1)
%设置音频播放器
isAudio金宝appSupported = audiodevinfo (0)
如果isAudio金宝appSupported
hap = dsp.AudioPlayer (“SampleRate”fs)
结束
%模拟
为m = 1: NSamPerFrame: NTSample
sig_idx = m: m + NSamPerFrame-1
x1 = wavread (“dft_voice_8kHz”[sig_idx (1) sig_idx(结束)))
temp =一步hCollector, x1, ang_dft +√(noisePwr) *兰德(rs, NSamPerFrame 4 [4]));
如果isAudio金宝appSupported
步骤(hap临时(:,3));
结束
sigArray (sig_idx:) = temp;
voice_dft (sig_idx) = x1;
结束
情节(t, sigArrary (:, 3));
接受的答案
宏磊陈
2013年3月7日
这个错误是因为你添加噪声的角度。我相信这是一个错误。这条线应该这样读
temp =一步hCollector, x1, ang_dft +√(noisePwr) *兰德(rs NSamPerFrame 16);
同时,在脚本的前一部分,你实例化
sigArray
,应该是
sigArray = 0 (NTSample, 16);
HTH