Main Content

info

Characteristic information about baseband file writer

Description

example

S = info(bbw) returns a structure containing characteristic information about the specified baseband file writer.

Note

All fields are determined and viewable after the object is run and locked. When the object is unlocked, only the Filename and NumSamplesWritten fields are available and viewable.

Examples

collapse all

Create a baseband file writer object specifying a sample rate of 1 kHz and a 0 Hz center frequency.

bbw = comm.BasebandFileWriter('baseband_data.bb',1000,0);

Save the date for today in the Metadata structure.

bbw.Metadata = struct('Date',date);

Generate two channels of QPSK-modulated data.

d = randi([0 3],1000,2);
x = pskmod(d,4,pi/4,'gray');

Write the baseband data to file baseband_data.bb.

bbw(x)

Display information about the baseband file writer. Then, release the object.

info(bbw)
ans = struct with fields:
             Filename: '/tmp/Bdoc22a_1891349_59546/tpee747ad5/comm-ex66490302/baseband_data.bb'
      SamplesPerFrame: 1000
          NumChannels: 2
             DataType: 'double'
    NumSamplesWritten: 1000

release(bbw)

Create a baseband file reader object to read the saved data. Display the metadata from the file.

bbr = comm.BasebandFileReader('baseband_data.bb', ...
    'SamplesPerFrame',100);
bbr.Metadata
ans = struct with fields:
    Date: '26-Feb-2022'

Read the data from the file.

z = [];

while ~isDone(bbr)
    y = bbr();
    z = cat(1,z,y);
end

Display information about the baseband file reader. Then, release object.

info(bbr)
ans = struct with fields:
    NumSamplesInData: 1000
            DataType: 'double'
      NumSamplesRead: 1000

release(bbr)

Confirm that the original modulated data x, matches the data z, read from file baseband_data.bb.

isequal(x,z)
ans = logical
   1

Input Arguments

collapse all

Baseband file writer, specified as a comm.BasebandFileWriter System object.

Output Arguments

collapse all

Characteristic information about the baseband file writer, returned as a structure containing these fields.

Name of the baseband file to write, returned as a character vector. The filename shows the absolute path.

Data Types: char

Number of samples in each frame, returned as a positive integer.

Dependencies

To enable this field, you must first run the baseband file writer object.

Data Types: double

Number of channels in the baseband signal written to the file, returned as a positive integer.

Dependencies

To enable this field, you must first run the baseband file writer object.

Data Types: double

Data type of the baseband signal written to the file, returned as 'double', 'single', 'uint8', 'uint16', 'uint32', 'uint64', 'int8', 'int16', 'int32', or 'int64'.

Dependencies

To enable this field, you must first run the baseband file writer object.

Total number of baseband data samples written to the file, returned as a positive integer. This field returns the smaller of the total number of samples processed by and the value of the NumSamplesToWrite property of the input baseband file writer object.

Data Types: double

Version History

Introduced in R2016b