info
Characteristic information about baseband file writer
Syntax
Description
Examples
Write Baseband Signal to File
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/Bdoc24b_2725827_3660646/tp51656bbd/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: '05-Sep-2024'
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
bbw
— Baseband file writer
comm.BasebandFileWriter
System object™
Baseband file writer, specified as a comm.BasebandFileWriter
System object.
Output Arguments
S
— Characteristic information about baseband file writer
structure
Characteristic information about the baseband file writer, returned as a structure. Default content include these fields.
Filename
— Name of baseband file to write
character vector
Name of the baseband file to write, returned as a character vector. The filename shows the absolute path.
Data Types: char
SamplesPerFrame
— Number of samples in each frame
positive integer
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
NumChannels
— Number of channels in baseband signal
positive integer
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
DataType
— Data type of baseband signal
'double'
|
'single'
|
'uint8'
|
'uint16'
| 'uint32'
| 'uint64'
| 'int8'
| 'int16'
| 'int32'
| 'int64'
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.
NumSamplesWritten
— Total number of baseband data samples written
positive integer
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 the input baseband file writer object and the
NumSamplesWritten
property of that object.
Data Types: double
Version History
Introduced in R2016b
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)