AM modulation and demodulation
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Eleftherios Kostakis
 il 26 Mag 2020
  
    
    
    
    
    Risposto: SINETHEMBA MNGUNI
 il 16 Ott 2020
            Hello, I have this signal m(t) = cos(2*pi*t),  and the AM signal of m : y = (Ac + m).*cos(2*fc*pi*t). 
The first plot is the original signal, the second plot is the AM signal and the last is the envelope of the modulated signal.
I want to get the original signal so I try to do demodulation to AM signal, using z = amdemod(y,fc,fs) and next get the envelope of the demolated singal
but I get again the AM's signal envelope. As you see y axis is in range (1,3) but I want it in range (-1,1) like the orginal signal. I want just to deduct the Ac I added in (Ac + m), to get the original, but with amdemod() I don't get that result.



0 Commenti
Risposta accettata
  Sebastien Dupertuis
    
 il 27 Mag 2020
        I think that by removing the mean (DC offset) of your demodulated signal in figure 3, you will then get your signal within the range (-1,1): 
m = m-mean(m);
I would write an amDemod function like this:
function m = amDemod(s,fc,fs,n)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Function amDemod()
% Goal  : Demodulation of an AM signal
% IN    : - s : AM modulated signal
%         - fc: Carrier signal frequency
%         - fs: Sampling frequency
%         - n : Number of carrier signal periods
% IN/OUT: -
% OUT   : - m : Original demodulated signal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Rectify the modulated signal
  s = abs(s);
  % Set the number of samples on which to do the moving average
  k = round(n*fs/fc);
  % Take the moving average
  m = movmean(s,k);
  % Remove the DC offset
  m = m-mean(m);
end
Hope this helps.
0 Commenti
Più risposte (1)
  SINETHEMBA MNGUNI
 il 16 Ott 2020
        Hi, I need to modulate and demoduate an Audio.wav signal, how can I go about it?
0 Commenti
Vedere anche
Categorie
				Scopri di più su Modulation in Help Center e File Exchange
			
	Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!