# How to modulate a signal to a certain frequency in time domain

I have a root-raised cosine pulse signal of bandwidth $$500$$ MHz. If the signal is modulated at the frequency $$6$$ GHz, the result should apparently look like this :

If I understand well, to modulate the root raised cosine, it needs to be "multiplied" by a signal like $$h \left( t \right) = \cos \left( \omega t \right)$$ with $$\omega = 2 \pi f$$ and $$f = 6$$ GHz. My problem is that, in Matlab, when I multiply my pulse by a cosine this is not the result I get at all. I get something like this :

Could someone please explain what I might be doing wrong here.

• It looks like you are plotting 16 different waveforms, as opposed to a single modulated waveform. Assuming that was intented, in addition to the sampling considerations that Dan mentioned, make sure you plot along the appropriate dimensions (i.e., rows vs columns).
– Ash
Jun 1, 2023 at 17:08
• Hello, thank you, this helped me resolve part of my problem. The problem was that Matlab was doing matrix multiplication instead of point by point multiplication of the vectors, hence why I got many waveforms instead of one. I am facing another problem now, is that, when I plot a cosine wave from -8 ns in time to 8 ns in time, and I choose for example 400 samples (or points) for the plot, I get a certain number of periods of the cosine in my plot, then if i change this number of samples (for example i put 500 samples instead of 400), I get a DIFFERENT number of periods in the plot but why.. Jun 16, 2023 at 18:04