DSPRelated.com
Forums

MSK signal

Started by ofdm December 4, 2006
>hi gon, > >i have this script written by matt wilbur (dowloaded) that returns the I >and Q channels of MSK/GMSK modulated waveforms. hope it helps. > >-fahim > >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >function [msk_phase,gmsk_phase,xi,xq,t] =gmsk(bits,Rb,ns,BT) > >% Title: bbgmsk.m >% Author: Matt Wilbur >% Date: October 19, 1998. >% >% Description: This function takes a NRZ sequences of bits >% (one sample per bit) and returns the phase >% of an MSK and GMSK signal modulated by them. >% >% It also returns the baseband in-phase >% and quadrature components of the GMSK >% signal ready for upconverting. >% >% This function accepts as arguments: >% >% bits - NRZ bit stream (one sample/bit) >% Rb - baseband bit rate >% ns - number of samples per bit >% BT - normalized bandwidth of Gaussian filter >% >% Modified: > >% Set up some timing variables > > Tb = 1/Rb; > fs = ns*Rb; > Ts = 1/fs; > >% Extend the number of bits by one to make the convolution below >% work out nicely > > numbits = max(size(bits)); > bits(numbits+1) = bits(numbits); > >% Generate the msk phase first > > bup = upfirdn(bits,ones(ns,1),ns,1); > bscale = bup * pi/2/ns; > bscale(1) = 0; > msk = cumsum(bscale); > >% Get the Gaussian impulse response > > % 3-dB BW of filter > > Bb = BT / Tb; > > % Time scale for filter --- 6 Bit periods to be safe > > t = -3*Tb:Ts:3*Tb; > > % Analog impulse from formulae > > h_a = sqrt(2*pi/log(2))*Bb*exp(-2*pi^2*Bb^2*t.^2/log(2)); > > % Digital impulse from impulse-response matching > > h_d = Ts*h_a; > >% Get the GMSK phase --- a few delay tricks so beware of shifting >% indices > > [temp,delay] = max(h_d); > > y = conv(h_d, msk); > upper_index = ns*numbits-1; > gmsk_phase = rem(y(delay:upper_index + delay), 2*pi); > msk_phase = msk(1:upper_index+1); > > t = 0:ns*numbits-1; > t = t/fs; > xi = cos(gmsk_phase); > xq = sin(gmsk_phase); >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>Hello, >> >>I am studying MSK modulation, does anyone know how to genrate a MSK >signal >>in matlab, pls help me..Thanks. >> >>Gon. >> >> >> > > >
thnks all