info
Get cumulative overrun and underrun
Syntax
Description
Examples
The dsp.AsyncBuffer System object™ supports reading variable frame sizes from the buffer.
Create a dsp.AsyncBuffer System object. The input is white Gaussian noise with a mean of 0, a standard deviation of 1, and a frame size of 512 samples. Write the input to the buffer using the write method.
asyncBuff = dsp.AsyncBuffer;
input = randn(512,1);
write(asyncBuff,input);
plot(input)
hold on
Store the data that is read from the buffer in outTotal.
Plot the input signal and data that is read from the buffer in the same plot. Read data from the buffer until all samples are read. In each iteration of the loop, randi determines the number of samples to read. Therefore, the signal is read in as a variable-size signal. The prevIndex variable keeps track of the previous index value that contains the data.
outTotal = zeros(size(input)); prevIndex = 0; while asyncBuff.NumUnreadSamples ~= 0 numToRead = randi([1,64]); out = read(asyncBuff,numToRead); outTotal(prevIndex+1:prevIndex+numToRead) = out; prevIndex = prevIndex+numToRead; end plot(outTotal,"r") hold off

Verify that the input data and the data read from the buffer (excluding the underrun samples, if any) are the same. The cumulative number of overrun and underrun samples in the buffer is determined by the info function.
S = info(asyncBuff)
S = struct with fields:
CumulativeOverrun: 0
CumulativeUnderrun: 28
The CumulativeUnderrun field shows the number of samples underrun per channel. Underrun occurs if you attempt to read more samples than available.
Input Arguments
Async buffer, specified as a dsp.AsyncBuffer
System object.
Output Arguments
Cumulative overrun and underrun information, returned as a structure. The fields for
S are described in the table.
| Field | Value |
|---|---|
CumulativeOverrun
| Number of samples overrun per channel since last call to
|
CumulativeUnderrun | Number of samples underrun per channel since last call to
|
The CumulativeOverrun and
CumulativeUnderrun properties are data type
int32.
Version History
Introduced in R2017a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)