Signal remains constant when implementing FSK I am trying to implement FSK Modulation. For bit 0 and 1, I defined a frequency wave (for instance, for bit 1, c = cos(2pift), with t = 0 : 1/fs : (1/fs)*N - 1/fs, where fs is the data rate). When I'm simulating, c is remaining constant (only value 1 for cosinus).

Why ? Because If a use a sinus, it is not remaining constant.

Thanks for avance.

Regards.

Code :

N = 1000; % number of bits
R = 1000; % bit rate
fs = 1/R;  % sampling rate

t = 0 : fs : N*fs - fs;
bits = round(rand(1,N));

f1 = R * 6; 
f2 = R * 4;

c1 = A*cos(2*pi*f1*t); % bit 1
c2 = A*cos(2*pi*f2*t); % bit 0
The sampling rate you're using is too low. The cosine signals have frequencies 4,000 and 6,000 Hz, but your sampling frequency is 1000.

An FSK signal has a very large bandwidth -- in theory, it is infinite. This is because of the sharp transistions between pulses of different frequencies. My suggestion is to use a sampling frequency that is around 5 to 10 times larger than your carrier, or around 25,000 to 50,000 samples per second in your case.