SSB LSB wrong spectrum

Hi,
i was trying to use ssbmod from Communication Toolbox to LSB modulate cosine carrier by square wave. From my perspective, all bands above a carrier frequency should not be in the spectrum. However, that is no the case. I cannot find an error. Any help will be apriciated.
close all
fs = 10*10^3; % sampling frequency [kHz]
Ts = 1/fs; % sampling period [ms]
t = 0 : Ts : 1-Ts; % time vector from 0 to 1-Ts [ms]
% Carrier signal
fc = 100; % carrier frequency [kHz]
uc = 2; % carrier amplitude [V]
carr = uc * cos(2*pi*fc*t); % Generation of carrier signal
% Modulating signal
fmod = 10; % modulating signal frequency [kHz]
umod = 1; % modulating signal amplitude [V]
duty = 50; % duty of modulating signal [%]
mod = umod * square(fmod*pi*t, duty);
% Actual modulation
lsb = ssbmod(mod, fc, fs);
figure(1)
nexttile
plot(t, carr);
title('Carrier signal');
TimeDomainInfo(uc);
nexttile
[carrierSpectrum, carrierFreqDom] = Spectrum(carr ,t);
stem(carrierFreqDom, carrierSpectrum)
title('Amplitude spectrum of carrier signal');
FreqDomainInfo( max(carrierSpectrum) );
xlim([0 2*fc])
nexttile
plot(t, mod);
title('Modulating signal');
TimeDomainInfo(umod);
nexttile
[modSpectrum, modFreqDom] = Spectrum(mod ,t);
stem(modFreqDom, modSpectrum)
title('Amplitude spectrum of modulating signal');
FreqDomainInfo( max(modSpectrum) );
xlim([0, 20*fmod])
nexttile
plot(t, lsb);
title('LSB signal');
TimeDomainInfo( max(lsb) );
nexttile
[lsbSpectrum, lsbFreqDom] = Spectrum(lsb, t);
stem(lsbFreqDom, lsbSpectrum)
title('Amplitude spectrum of LSB signal');
FreqDomainInfo( max(lsbSpectrum) );
xlim([0 2*fc])
figure(2)
[lsbSpectrum, lsbFreqDom] = Spectrum(lsb, t);
stem(lsbFreqDom, lsbSpectrum)
title('Amplitude spectrum of LSB signal');
FreqDomainInfo( max(lsbSpectrum) );
xlim([0 2*fc])
function [spectrum, freqrange] = Spectrum(signal, t)
nfft = length(t); % FFT window length equal to length of t vector
spectrum = fft(signal, nfft); % calculating fft of singal
spectrum = spectrum(1 : nfft/2); % removing negative frequencies of the fft spectrum
scalefactor = nfft/2; % Calculating scale factor for amplitude spectrum
% Calculating amplitude spectrum
spectrum = spectrum / scalefactor; % Dividing all fft spectrum samples by scale factor
spectrum = abs(spectrum); % Calculating absolute value of fft complex samples
freqrange = 0 : 1 : nfft/2 - 1; % Creating frequency domain vector
end
function TimeDomainInfo(amp)
xlabel('Time [ms]');
ylabel('Amplitude [V]');
ylim([-1.25*amp 1.25*amp]);
grid on
yline(0)
end
function FreqDomainInfo(amp)
xlabel('Frequency [kHz]');
ylabel('Amplitude [V]');
ylim([0 1.25*amp]);
grid on
end

Respuestas (1)

Przemyslaw Buziuk
Przemyslaw Buziuk el 17 de Feb. de 2024

0 votos

I got same problem when using an ammod for DSB-SC - when using squre wave as a spectrum aren't simetrical, right side of spectrum have higher amplitudes than the left side.

Productos

Versión

R2023b

Preguntada:

el 17 de Feb. de 2024

Editada:

el 17 de Feb. de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by