- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhelperModClassPlotSpectrogram.m
More file actions
Latest commit
22 lines (19 loc) · 896 Bytes
/
Copy pathhelperModClassPlotSpectrogram.m
File metadata and controls
22 lines (19 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function helperModClassPlotSpectrogram(dataDirectory,modulationTypes,fs,sps)
%helperModClassPlotSpectrogram Spectrogram of frames
% helperModClassPlotSpectrogram(DIR,MODTYPES,FS,SPS) plots a spectrogram
% for each modulation type specified in MODTYPES using datafiles in the
% DIR folder. FS is the sample rate. SPS is the samples per symbol.
%
% See also ModulationClassificationWithDeepLearningExample.
% Copyright 2019 The MathWorks, Inc.
numRows = ceil(length(modulationTypes) /4);
for modType=1:length(modulationTypes)
subplot(numRows, 4, modType);
files = dir(fullfile(dataDirectory,"*"+ string(modulationTypes(modType)) +"*"));
idx =10;
load(fullfile(files(idx).folder, files(idx).name), 'frame');
spectrogram(frame,kaiser(sps),0,1024,fs,'centered');
title(string(modulationTypes(modType)));
end
h =gcf; delete(findall(h.Children, 'Type', 'ColorBar'))
end