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_2679053_1670783/tp29d70b66/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: '20-Jul-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 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
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)