Up-converting a sinusoidal signal I want to up-convert a baseband sinusoidal signal of frequency $4000 \, \rm{Hz}$ using a carrier frequency of $20\, \rm{KHz}$. I read that one can up-convert a baseband signal to a passband signal using the following.



But after convolution with a carrier cosine, I get a $16\, \rm{KHz}$ signal. What could be the problem?

I used following Python code to do convolution with carrier frequency: samples * cosineSignal.
A 48k sample rate is too low to reliably reproduce your upper side of 20k+4k = 24kHz.  Thus you end up with a LSB (lower sideband SSB) signal, not an AM signal.