主要内容

mls

Maximum length sequence

Description

励磁= mls返回使用最大长度序列(MLS)技术产生的激发信号。这种类型的序列是伪随机二进制序列。

example

励磁= mls(L)specifies the output lengthL激发信号。

example

励磁= mls(L,Name,Value)specifies options using one or moreName,Valuepair arguments, in addition to the input arguments in the previous syntaxes.

Examples

collapse all

利用audioreadto read in an impulse response recording. Create adsp.FrequencyDomainFirfilter对象使用已知的脉冲响应执行频域过滤。

[IRKONWONK,FS] = Audioread('ChurchImperserSponse-16-44p1-Mono-5secs.wav'); systemModel = dsp.FrequencyDomainFIRFilter(irKnown');

通过使用mls功能。MLS激发信号必须比脉冲响应更长。请注意,MLS激发的长度扩展到了两个负元的下一个功率。

激发= mls(numel(irkone)+1);情节(激发)标题('Excitation')

图包含一个轴对象。The axes object with title Excitation contains an object of type line.

Replicate the excitation signal four times to measure the average of three measurements. The recording of the first MLS sequence does include all the impulse response information, soimpzestdiscards it as a warmup run. Pad the excitation signal with zeros to account for the filter latency.

numRuns = 4; excrep = repmat(excitation,numRuns,1); excrep = [excrep;zeros(numel(irKnown)+1,1)];

将激发信号传递通过已知过滤器,然后添加噪声以建模真实的记录(系统响应)。切割过滤器在开头引入的延迟。

rec = systemModel(excrep); rec = rec + 0.1*randn(size(rec)); rec = rec(numel(irKnown)+2:end,:); plot(rec) title('System Response')

图包含一个轴对象。The axes object with title System Response contains an object of type line.

在现实世界中,MLS序列在录制时测试的系统中播放。记录将被切割,以便从拾取MLS序列开始并截断以持续重复序列的持续时间。

Pass the excitation signal and the system response to theimpzestfunction to estimate the impulse response. Plot the known impulse response and the simulation of the estimated impulse response for comparison.

irestimate = impzest(激发,rec);样本= 1:numel(irkone);情节(样品,生气(样品),'bo',...samples,irKnown(samples),“ m。”) legend('Known impulse response',“估计脉冲响应的模拟”)

图包含一个轴对象。轴对象包含2个类型行的对象。这些对象代表已知的脉冲响应,模拟了估计的脉冲响应。

生成一个长度为2^14-1样品的MLS信号,其水平为-5 dB。

L = 2^14-1;水平= -5;激发= mls(l,“激发”,level);

Visualize the excitation in time and time-frequency. For the time-domain plot, plot only the first 200 samples for visibility. The pattern is constant.

plot(excitation(1:200))

图包含一个轴对象。The axes object contains an object of type line.

频谱图(激发,512,0,1024,'yaxis')

图包含一个轴对象。The axes object contains an object of type image.

Input Arguments

collapse all

Length of excitation signal to generate, specified as a scalar in the range [3,229).

请求的输出长度Lmust be a power of two minus one. Otherwise, the output length increases to the next valid length.

Note

If you use the excitation signal generated by themls记录和估计系统的脉冲响应的功能,那么激发信号的长度必须至少与要估计的脉冲响应至少要长。

Data Types:single|double

Name-Value Arguments

将可选的参数对Name1=Value1,...,NameN=ValueN, whereNameis the argument name and价值是相应的值。名称值参数必须在其他参数之后出现,但是对的顺序并不重要。

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

例子:“激发”,-5

Level of the excitation signal to generate in dB, specified as a scalar in the range[-42,0].

Data Types:single|double

Output Arguments

collapse all

Excitation signal generated using the maximum length sequence (MLS) technique, returned as a column vector.

Data Types:single|double

参考

[1] Guy-Bart, Stan, Jean-Jacques Embrechts, and Dominique Archambeau. "Comparison of Different Impulse Response Measurement Techniques."Journal of Audio Engineering Society. Vol. 50, Issue 4, 2002, pp. 246–262.

Extended Capabilities

C/C++ Code Generation
使用MATLAB®CODER™生成C和C ++代码。

Version History

Introduced in R2018b