Changing the size on input 1 is not allowed without first calling the release() method.

10 views (last 30 days)
Faheem Ur Rehman
Faheem Ur Rehman on 3 Jun 2021
Commented: Walter Roberson on 3 Jun 2021
I want to generate the 16ASK modulation using apskmod function by modifying the Autometic Modulation classifcation example of MATALB, but got an error. here x is the audio wave file.
sps = 8;
modulationTypes = categorical(["BPSK", "QPSK", "8PSK", "16PSK","32PSK"...
"16QAM", "32QAM","64QAM","128QAM", "256QAM","16APSK","PAM4", "GFSK", "CPFSK" ...
"B-FM", "DSB-AM", "SSB-AM"]);
rng(1235)
tic
numModulationTypes = length(modulationTypes);
for modType = 1:numModulationTypes
fprintf('%s - Generating %s frames\n', ...
datestr(toc/86400,'HH:MM:SS'), modulationTypes(modType))
label = modulationTypes(modType);
numSymbols = (numFramesPerModType / sps);
dataSrc = helperModClassGetSource(modulationTypes(modType), sps, 2*spf, fs);
modulator = helperModClassGetModulator(modulationTypes(modType), sps, fs);
if contains(char(modulationTypes(modType)), {'B-FM','DSB-AM','SSB-AM'})
% Analog modulation types use a center frequency of 100 MHz
channel.CenterFrequency = 100e6;
else
% Digital modulation types use a center frequency of 902 MHz
channel.CenterFrequency = 902e6;
end
The above one is main function and i have uploaded the 2 function whihc are being called by main function.
  3 Comments
Walter Roberson
Walter Roberson on 3 Jun 2021
spf is not defined. fs is not defined.
here x is the audio wave file.
? There is no reference to x in the code ?
When I put in spf = 128; fs = 22050; and run the code you posted, there is no error generated.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by