25 lines
834 B
Matlab
25 lines
834 B
Matlab
|
|
function [BER,EQ_sig,Noi] = runEQ(Eq_class,Scpe_sig,Symbols,Bits,M)
|
|
|
|
[EQ_sig] = Eq_class.process(Scpe_sig,Symbols);
|
|
|
|
Noi = EQ_sig-Symbols;
|
|
|
|
|
|
Rx_bits = PAMmapper(M,0).demap(EQ_sig);
|
|
|
|
[~,errors_bm,BER,errors] = calc_ber(Rx_bits.signal,Bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1);
|
|
|
|
if 0
|
|
figure();
|
|
constellation = unique(Symbols.signal);
|
|
received = NaN(numel(constellation),length(Symbols));
|
|
for lvl = 1:numel(constellation)
|
|
received(lvl,Symbols.signal==constellation(lvl)) = EQ_sig.signal(Symbols.signal==constellation(lvl));
|
|
hold on
|
|
histogram(received(lvl,:),1000,"EdgeAlpha",0);
|
|
end
|
|
|
|
Noi.spectrum("displayname",['Error PSD after: ',inputname(1),' '],'fignum',564);
|
|
end
|
|
end |