Error using comm.PSKModulator/step. Inputs must be either numeric or logical variables or fi objects.
조회 수: 2 (최근 30일)
이전 댓글 표시
I'm getting above error while I'm trying to modulate a sequence of bits using PSK Modulation in Matlab. Below is the code snippet for the same which is giving me the error.
levels = 4; input_signal = rand(48,1); % generating a sequence of 48 random numbers between [0,1] % partition= [0.25,0.5,0.75,1.0]; codebook = [0,0.25,0.5,0.75,1.0]; [index,q] = quantiz(input_signal,partition,codebook); % trying to quantize them to 4 levels % bin_data = zeros(log2(levels)); % converting above four levels to two bit binary% for i=1:length(q) ind = find(codebook==q(i))-1; if (i ==1) bin_data = dec2bin(ind,log2(levels)); else bin_data=horzcat(bin_data,dec2bin(ind,log2(levels))); end end output = transpose(bin_data); psk_modulator = comm.PSKModulator(16,'BitInput',true); psk_modulator.PhaseOffset = pi/16; modulated_data = step(psk_modulator, output)
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 PSK에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!