Professional Documents
Culture Documents
Lab.9. Frame Based Processing
Lab.9. Frame Based Processing
Lab.8. Tutorial
(draft)
Introduction to Frame-based Processing
Definition
1) Accelerating Real Time: Framed-based data is a common format in real-time systems. Data
acquisition hardware often operates by accumulating a large number of signal samples at a
high rate, and propagating these samples to the real-time system as a block of data. This
maximizes the efficiency of the system by distributing the fixed process overhead across many
samples; the "fast" data acquisition is suspended by "slow" interrupt processes after each frame
is acquired, rather than after each individual sample.
The figure below illustrates how throughput is increased by frame-based data acquisition.
The thin blocks each represent the time elapsed during acquisition of a sample. The thicker
blocks each represent the time elapsed during the interrupt service routine (ISR) that reads the
data from the hardware.
In this example, the frame-based operation acquires a frame of 16 samples between each
ISR. The frame-based throughput rate is therefore many times higher than the sample-based
alternative.
It's important to note that frame-based processing will introduce a certain amount of
latency into a process due to the inherent lag in buffering the initial frame. In many instances,
however, it is possible to select frame sizes that improve throughput without creating
unacceptable latencies.
The input frame period (Tfi) of a frame-based signal is the time interval between consecutive
vector or matrix inputs to a block. This interval is what the Probe block displays when you
connect it to a frame-based input line. Similarly, the output frame period (Tfo) is the time
interval at which the block updates the frame-based vector or matrix value at the output port.
This interval is what the Probe block displays when you connect it to a frame-based output
line.
In contrast, the sample period, Ts, is the time interval between individual samples in a
frame, which is necessarily shorter than the frame period when the frame size is greater than 1.
The sample period of a frame-based signal is the quotient of the frame period and the frame
size, M:
More specifically, the sample periods of inputs (Tsi) and outputs (Tso) are related to their
respective frame periods by
where Mi and Mo are the input and output frame sizes, respectively.
The illustration below shows a one-channel frame-based signal with a frame size (Mi)
of 4 and a frame period (Tfi) of 1. The sample period, Tsi, is therefore 1/4, or 0.25 second. A
Probe block connected to this signal would display the frame period Tfi = 1.
In most cases, the sequence sample period Tsi is of primary interest, while the frame
rate is simply a consequence of the frame size that you choose for the signal. For a sequence
with a given sample period, a larger frame size corresponds to a slower frame rate, and vice
versa.
For better illustration, Figure below shows an example of what you should see on the
oscilloscope screen in Lab.9. The two smaller peaks correspond to the frequency content of the
input signal computed using the DFT. The larger, negative peaks correspond to impulses added
to the output signal every 128 samples.