jess17
Junior Member level 3
ok i need to do FSK on a sine wave, but i keep getting an error saying
" ??? Error using ==> dpskmod at 41
Elements of input X must be integers in the range [0, M-1].
Error in ==> dpskmodulation at 15
sig = dpskmod(x,M,pi / 8 ) ; "
my code is as follows:
M = 4; % Use DQPSK in this example, so M is 4.
Fs = 100;
t = [0:2*Fs+1]'/Fs;
Fc = 10; % Carrier frequency
x = sin(2*pi*t); % Sinusoidal signal
figure(1)
plot(t, x);
sig = dpskmod(x,M,pi / 8 ) ;
figure(2)
plot % Plot all points, using lines to connect them.
" ??? Error using ==> dpskmod at 41
Elements of input X must be integers in the range [0, M-1].
Error in ==> dpskmodulation at 15
sig = dpskmod(x,M,pi / 8 ) ; "
my code is as follows:
M = 4; % Use DQPSK in this example, so M is 4.
Fs = 100;
t = [0:2*Fs+1]'/Fs;
Fc = 10; % Carrier frequency
x = sin(2*pi*t); % Sinusoidal signal
figure(1)
plot(t, x);
sig = dpskmod(x,M,pi / 8 ) ;
figure(2)
plot % Plot all points, using lines to connect them.