function plotRF(x,y,fs,fc);
%  plotrf(x,y,fs,fc)
%  x and y are baseband signal vectors of equal length
%  L, a power of 2
%  fc is the carrier frequency 
%  fs is the sampling frequency.  fc << fs/2.
	L=length(x);M=2048;ts=1/fs;t=ts*[0:L-1];
	z=x+j*y; % the complex baseband signal
	r=abs(z); % the envelope
	s= real(z.*exp(j*2*pi*fc*t));% the rf signal
	b=1.2*max(r);
	subplot(3,1,1)
	spectrm(s,fs)
	xlabel('RF spectrum vs f')
	subplot(3,2,3)
	plot((L/M)*ts*[0:M-1],upsample(s),'k')
	axis([0, L*ts, -b b]) 
	xlabel('RF signal vs t')
	subplot(3,2,4)
	plot(t,x,'b',t,y,'r')
	axis([0, L*ts, -b b])
	xlabel('I and Q baseband signals vs t')
	subplot(3,2,5)
	plot(t,r)
	axis([0, L*ts, 0 b])
	xlabel('envelope vs t')
	subplot(3,2,6)
	plot(t,angle(z)/pi)
	axis([0, L*ts, -1.2 1.2])
	xlabel('phase/pi vs t')