# How we can represent a bandpass signal equation in matlab

The general form of bandpass signal is given by $$s(t) = \Re\{S_b(t)\exp(j2 \pi f_ct)\}$$ How this can be represented in matlab.

• Why do you want to represent it? In matlab we usually use the discrete-time representation, which is easier. Commented Sep 26, 2019 at 19:26

Usually (almost always), simulation is done using the discrete time baseband signal. Lets say you want to simulate 32 BPSK symbols (either +1 or -1). The MATLAB code for this is:

 symbols = sign( rand(32, 1) - 0.5 );

Now that you have the symbols, the next step is to upsample. You can either use the MATLAB function or do it yourself:

 symbols_up = upsample(symbols, samplesPerSymbol);

Then create and use a pulse shaping filter (just use rcosdesign):

 pulseFilter = rcosdesign(rolloff, span, samplesPerSymbol, 'sqrt'); txSig = filter(pulseFilter, 1, symbols_up); figure, plot(txSig) 

• you explained it exactly... thanks. But what about real part of that equation. Commented Sep 28, 2019 at 0:59
• Yes, its part of the passband representation. I suggest you read about how communication signals are represented (baseband vs. passband). Any textbook would have this covered, or see wikipedia Commented Sep 29, 2019 at 18:16
• Yes.....I had understood theory pretty well but has doubt in Matlab implementation of this equation. Basically I had more equations of similar kind and hence wants to clear the concept from Matlab point of view. Commented Oct 1, 2019 at 10:25
• I'm not sure what you mean but as far as from a MATLAB implementation its pretty uncommon to actually simulate the analog signals. Computers are digital so we stick to discrete time baseband and use equations/physics to model how analog effects appear in the baseband signal. My only thought is if you want to look at passband signals is maybe look into ray tracing simulators? But I have no experience, just know that people use them and they exist Commented Oct 1, 2019 at 13:18
• Ok....got the point.. Commented Oct 2, 2019 at 15:03