Label Radar Signals with Signal Labeler
此示例显示了如何标记脉冲雷达信号的主要时间和频率特征。此步骤促进了创建完整而准确的数据集以培训人工智能(AI)模型的过程。信号标签eases this task in two ways. In manual mode, synchronized time and time-frequency views help you identify frequency features such as the waveform type, which can be长方形
,,,,线性
, 或者Steppedfm
。In automated mode, you can register functions that measure the pulse repetition frequency (PRF), pulse width, duty cycle, and pulse bandwidth and only correct mistakes instead of labeling all signals from scratch. A built-in dashboard helps track the labeling progress and assess the quality of the labels.
将数据导入信号标签
这radar signals in this example are stored in individual MAT files. Each file contains a data variableX
和相应的采样率变量FS
。
打开信号标签。在Labeler选项卡,单击Import并选择From Folders
in theMemberslist. In the dialog box, select the directory with radar signal files. To specify the signal variables that you want to read, click指定and enterX
。添加时间信息:选择在工作
option and select时间
从列表中。选择文件率变量
在列表中输入FS
。点击Import。这imported files appear in the标记的信号集浏览器。Plot the first three signals by selecting the check boxes next to their names.
定义标签
Create a label definition for the signal waveform type.
点击添加on theLabeler选项卡和选择
添加Label Definition
。In the dialog box, specify标签名称作为
waveformtype
。SetLabel Type到属性
andData Type到细绳
。点击OK。
Repeat these steps to create attribute label definitions for PRF, duty cycle, and bandwidth. Modify the label name for each and set the data type tonumeric
。
为脉冲宽度创建一个利益区域(ROI)标签,对应于显示用于计算每个脉冲宽度的初始和最终交叉点的区域。指定标签名称作为脉搏宽
,,,,Label Type作为ROI, andData Type作为numeric
。标签定义出现在Label Definitions浏览器。
创建自定义自动标签功能
Use four自定义标签功能到label the PRF, bandwidth, duty cycle, and pulse width. Code for these functions is given in the金宝app支持功能section of the example. To create each function, on theLabeler选项卡,单击Automate Value并选择添加Custom Function。信号标签显示一个对话框,您可以在其中输入函数的名称,描述和标签类型。
For the function that computes the PRF, enter
computePRF
in the姓名字段和选择属性
作为Label Type。You can leave theDescriptionfield empty or you can enter your own description.对于计算带宽的函数,请输入
computeBandWidth
in the姓名字段和选择属性
作为Label Type。You can leave theDescriptionfield empty or you can enter your own description.对于计算占空比的功能,请输入
计算机周期
in the姓名字段和选择属性
作为Label Type。You can leave theDescriptionfield empty or you can enter your own description.对于计算脉冲宽度的函数,请输入
ComputePulSeWidth
in the姓名字段和选择ROI
作为Label Type。You can leave theDescriptionfield empty or you can enter your own description.
如果您已经编写了功能,并且功能在当前文件夹中或MATLAB®路径中,则信号标签adds the functions to the gallery. If you have not written the functions,信号标签打开编辑器中的空白模板供您键入或粘贴代码。保存文件。保存文件后,功能将出现在图库中。
Label Waveform Type, PRF, Bandwidth, Duty Cycle, and Pulse Width
Set the waveform type of each signal:
In the标记的信号集浏览器,,,,select the check box next to
radardata1
。点击the展示选项卡和选择Spectrogramin the视图部分。该应用显示一组具有信号谱图和A的轴Spectrogram选项选项,以控制视图。
点击theSpectrogram标签并将重叠百分比设置为
99
。频谱图显示信号波形是矩形。在标签查看器属性表中,双击下面的单元格waveformtype和类型
长方形
。Repeat this manual labeling step for all the signals in the data set.
An example of a线性
waveform follows.
An example of aSteppedfm
waveform follows.
计算输入信号的PRF并标记。
选择
prf
in theLabel Definitions浏览器。In theAutomate Valuegallery, select
computePRF
。点击Auto-Label并选择
Auto-Label All Signals
。In the dialog box that appears, clickOK。
Repeat the above steps for bandwidth, duty cycle, and pulse width by selecting the corresponding label definition and autolabeling function.
信号标签计算和标记所有信号,但仅显示选择复选框的信号标签。绘制前五个成员的信号。
Validate Labeled Signals
查看您的标签进度并验证计算的标签值是否正确。选择waveformtype
in theLabel Definitionsbrowser and click仪表盘in theLabelertab.
这plot on the left shows the labeling progress, which is 100% as all signals are labeled with thewaveformtype
label. The plot on the right shows the number of signals with labels for each label value. You can use the标签分布饼图评估标签的准确性并确认结果是预期的。
接下来,验证所有脉冲宽度标签值均在周围分布5E-5
。To look at the time distribution of the pulse width label values, clickDefinition Selectionon the仪表盘选项卡和选择脉搏宽。单击时间分布图和仪表盘tab, set垃圾箱到3
,,,,X分钟到4E-5
andX Max到6e-5
。All signals have a pulse width distributed around5E-5
。
Close the dashboard.
导出标记为信号
将标记的信号导出到训练AI模型。在Labeler选项卡,单击Export并选择Labeled Signal Set To File
。在出现的对话框中,给出名称radarDataLss.mat
到the labeled signal set and add an optional short description. ClickExport。
Go back to the MATLAB® Command Window. Load the labeled signal set and create signal and label datastores from the labeled signal set. Create a combined datastore with the signal and label datastores. Useread
or读取
要获得信号标签对,您可以用来训练AI型号。
加载radarDataLss.mat[signalDS,labelDs] = ls.createDatastores(“ waveformtype”);组合= combine(信号,labelds);
金宝app支持功能
computePRF
功能:计算脉冲重复频率
这computePRF
功能计算并标记输入信号的PRF。它使用Pulseperiod
功能。
function[labelval,libelloc] = computeprf(x,t,parentlabelval,parentlabelloc,varargin)%功能以计算雷达脉冲的脉冲重复频率if〜isreal(x)x = abs(x);结尾pri = pulseperiod(x,t); labelVal = 1/pri(1); labelLoc = [];结尾
computeBandWidth
Function: Calculate the pulse bandwidth
这computeBandWidth
功能计算并标记输入信号的带宽。它使用obw
功能。
function[labelval,libelloc] = computebandwidth(x,t,parentlabelval,〜,varargin)%功能以计算雷达脉冲的带宽if〜isreal(x)x = abs(x);结尾fs = 1/mean(diff(t)); labelVal = obw(x,fs); labelLoc = [];结尾
计算机周期
Function: Calculate the pulse duty cycle
这计算机周期
功能计算并标记输入信号的占空比。它使用占空比
功能。
function[labelVal,labelLoc] = computeDutyCycle(x,t,parentLabelVal,parentLabelLoc,varargin)%功能以计算雷达脉冲的占空比if〜isreal(x)x = abs(x);结尾labelVal = dutycycle(x,t); labelLoc = [];结尾
ComputePulSeWidth
Function: Calculate the pulse width
这ComputePulSeWidth
function computes and labels the pulse width of the input signal. It uses thepulsewidth
功能。
function[labelval,libelloc] = computepulsewidth(x,t,parentlabelval,parentlabelloc,varargin)% Function to calculate pulse width of a radar pulseif〜isreal(x)x = abs(x);结尾[pw,ic,fc] = pulsewidth(x,t); labelVal = pw(1); labelLoc = [ic(1) fc(1)];结尾