I need to upsample a 2 MHz signal by a factor of 3000 to convert the OQPSK modulated baseband signal to passband. When I upsample by duplicating the elements in the sequence, I seem to get less error compared to padding the sequence with zeros. The frequency spectrum is also better when I duplicate elements whereas with zero padding, the spectrum shows nothing. I am now confused on which way is the right method to upsample a sequence and why.
Neither is correct. You should interpolate between samples if you need to convert to a higher sampling rate.
Linear interpolation is easiest, but will cause harmonics to appear in the output.
Linear interpolation with a lowpass filter is better. Use the nyquist frequency for your original signal (before upsampling) as the cutoff for the lowpass.
There are other methods that you can find fairly easily now that you know what you need to look for.
I don't know enough about what you are doing to be certain, but I'm pretty sure that upsampling to that extent shouldn't be neccessary unless you are doing something special - like working backwards from a result to compare to some original signal.
Matlab’s ‘upsample()’ command does not “pad” a sequence with zero-valued samples. The ‘upsample()’ command “stuffs” a sequence with zero-valued samples. “Zero padding” and “zero stuffing” are two different operations. “Zero padding” means appending a sequential string (a sequence) of zero-valued samples to the beginning or end of a sequence.
I believe what you want to do is: ‘Upsample()” your time-domain sequence to the desired final sample rate that's compatible with your 2.4 GHz carrier sequence. Next, lowpass filter the upsampled sequence. Then multiply the filtered sequence by your high-frequency carrier sequence.