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.
1 Answer
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)
-
$\begingroup$ you explained it exactly... thanks. But what about real part of that equation. $\endgroup$– charuCommented Sep 28, 2019 at 0:59
-
$\begingroup$ 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 $\endgroup$– EngineerCommented Sep 29, 2019 at 18:16
-
$\begingroup$ 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. $\endgroup$– charuCommented Oct 1, 2019 at 10:25
-
$\begingroup$ 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 $\endgroup$– EngineerCommented Oct 1, 2019 at 13:18
-