Main Content

고조파 왜곡 분석하기

이 예제에서는 잡음의 영향을 받고 있는 약한 비선형 시스템의 고조파 왜곡을 분석하는 방법을 보여줍니다.

소개

이 예제에서는 입력 신호에 잡음이 있어 비선형성을 나타내는 간단한 증폭기 모델의 출력값을 살펴봅니다. 그런 다음 입력값 감쇠를 통해 어떻게 고조파 왜곡을 줄일 수 있는지 살펴봅니다. 또한 증폭기 출력에서 발생한 왜곡을 수학적으로 해결하는 방법을 예제를 통해 알아보겠습니다.

비선형성의 영향 확인하기

증폭기의 비선형성이 미치는 영향을 확인하는 편리한 방법은 정현파로 시뮬레이션할 때 출력값의 주기도를 확인하는 것입니다. 정현파의 진폭은 증폭기에서 허용되는 최대 전압으로 설정되어 있습니다. (2Vpk)

이 예제에서는 50밀리초 동안 2kHz 정현파를 공급하겠습니다.

VmaxPk = 2;       % Maximum operating voltage
Fi = 2000;        % Sinusoidal frequency of 2 kHz
Fs = 44.1e3;      % Sample rate of 44.1kHz
Tstop = 50e-3;    % Duration of sinusoid
t = 0:1/Fs:Tstop; % Input time vector

% Use the maximum allowable voltage of the amplifier
inputVmax = VmaxPk*sin(2*pi*Fi*t);
outputVmax = helperHarmonicDistortionAmplifier(inputVmax);

출력 정현파의 확대된 영역을 표시합니다. 참고로, 시간을 기준으로 플로팅할 경우 증폭기의 불완전성을 시각적으로 확인하기 어렵습니다.

plot(t, outputVmax)
xlabel('Time')
ylabel('Output Voltage')
axis([0 5e-3 -2.5 2.5])
title('Amplifier output')

Figure contains an axes object. The axes object with title Amplifier output, xlabel Time, ylabel Output Voltage contains an object of type line.

이제 증폭기 출력값의 주기도를 보겠습니다.

helperPlotPeriodogram(outputVmax, Fs, 'power','annotate');

Figure contains an axes object. The axes object with title Periodogram Power Spectrum Estimate, xlabel Frequency (kHz), ylabel Power (dB) contains 3 objects of type line, text. One or more of the lines displays its values using only markers

입력값에 배치한 2kHz 정현파 대신 4kHz, 6kHz, 8kHz, 10kHz의 다른 정현파가 보입니다. 이들 정현파는 기본 2kHz 주파수의 배수로, 증폭기의 비선형성으로 인한 것입니다.

또한 잡음 전력 대역이 비교적 평탄한 것을 확인할 수 있습니다.

비선형 왜곡 수치화하기

왜곡과 관련해 주로 사용되는 몇 가지 메트릭을 비교해 보겠습니다.

다음 주기도는 기본 신호의 잘 정의된 일부 고조파를 보여줍니다. 이를 근거로 입력 신호의 총 고조파 왜곡을 측정하면 기본 신호에 대한 모든 고조파 성분의 전력 비율이 반환됩니다.

thd(outputVmax, Fs)

Figure contains an axes object. The axes object with title THD: -60.39 dB, xlabel Frequency (kHz), ylabel Power (dB) contains 16 objects of type line, text. These objects represent Fundamental, Harmonics, DC and Noise (excluded).

ans = -60.3888

가장 큰 고조파인 제3 고조파가 기본파보다 약 60dB만큼 작음을 알 수 있습니다. 여기에서 대부분의 왜곡이 발생합니다.

입력값에 존재하는 총 잡음의 추정값도 얻을 수 있습니다. 이 추정값을 얻으려면 SNR을 호출합니다. 그러면 고조파가 아닌 모든 성분의 전력에 대한 기본 신호의 전력 비율이 반환됩니다.

snr(outputVmax, Fs)

Figure contains an axes object. The axes object with title SNR: 130.93 dB, xlabel Frequency (kHz), ylabel Power (dB) contains 17 objects of type line, text. These objects represent Fundamental, Noise, DC and Harmonics (excluded).

ans = 130.9300

계산에 유용한 또 다른 메트릭은 SINAD입니다. 이 메트릭은 신호에 존재하는 기타 모든 고조파 및 잡음 성분에 대한 전력의 비율을 계산합니다.

sinad(outputVmax, Fs)

Figure contains an axes object. The axes object with title SINAD: 60.39 dB, xlabel Frequency (kHz), ylabel Power (dB) contains 7 objects of type line, text. These objects represent Fundamental, Noise and Distortion, DC (excluded).

ans = 60.3888

THD, SNR, SINAD는 각각 -60dB, 131dB, 60dB입니다. THD의 크기가 SINAD의 크기와 거의 같기 때문에, 대부분의 왜곡이 고조파 왜곡 때문인 것으로 볼 수 있습니다.

주기도를 살펴보면, 제3 고조파가 출력값 왜곡의 대부분을 차지하는 것을 알 수 있습니다.

입력값 감쇠를 통해 고조파 왜곡 줄이기

증폭을 수행하는 대부분의 아날로그 회로에는 고조파 왜곡과 잡음 전력 간의 상호 절충 관계가 내재되어 있습니다. 위의 예제에서 증폭기는 고조파 왜곡에 비해 잡음 전력이 상대적으로 낮습니다. 이러한 특성 때문에 전력이 낮은 신호를 감지하는 데 적합합니다. 입력값을 감쇠하여 이러한 저전력 영역에 진입할 수 있는 경우 고조파 왜곡을 일부 복구할 수 있습니다.

입력 전압을 2배 낮춰 측정을 반복해 보겠습니다.

inputVhalf = (VmaxPk/2) * sin(2*pi*Fi*t);
outputVhalf = helperHarmonicDistortionAmplifier(inputVhalf);
helperPlotPeriodogram(outputVhalf, Fs, 'power','annotate');

Figure contains an axes object. The axes object with title Periodogram Power Spectrum Estimate, xlabel Frequency (kHz), ylabel Power (dB) contains 3 objects of type line, text. One or more of the lines displays its values using only markers

메트릭을 다시 얻되, 이번에는 입력 전압 감소가 미치는 영향을 측정해 보겠습니다.

thdVhalf = thd(outputVhalf, Fs)
thdVhalf = -72.0676
snrVhalf = snr(outputVhalf, Fs)
snrVhalf = 124.8767
sinadVhalf = sinad(outputVhalf, Fs)
sinadVhalf = 72.0676

입력 전력 수준을 6dB만큼만 감쇠해도 고조파 성분이 감소함을 알 수 있습니다. SINAD와 THD가 ~60dB에서 ~72dB로 향상되었습니다. 그 대신 SNR이 131dB에서 125dB로 낮아졌습니다.

입력 감쇠에 대한 함수로서의 SNR, THD, SINAD

감쇠를 증가시키면 전체 왜곡을 개선할 수 있을까요? THD, SNR, SINAD를 입력 감쇠의 함수로 플로팅하고, 입력 감쇠기를 1dB에서 30dB까지 스윕해 보겠습니다.

% Allocate a table with 30 entries
nReadings = 30;
distortionTable = zeros(nReadings, 3);

% Compute the THD, SNR and SINAD for each of the attenuation settings
for i = 1:nReadings
  inputVbestAtten = db2mag(-i) * VmaxPk * sin(2*pi*Fi*t);
  outputVbestAtten = helperHarmonicDistortionAmplifier(inputVbestAtten);
  distortionTable(i,:) = [abs(thd(outputVbestAtten, Fs))
                          snr(outputVbestAtten, Fs)
                          sinad(outputVbestAtten, Fs)];
end

% Plot results
plot(distortionTable)
xlabel('Input Attenuation (dB)')
ylabel('Dynamic Range (dB)')
legend('|THD|','SNR','SINAD','Location','best')
title('Distortion Metrics vs. Input Attenuation')

Figure contains an axes object. The axes object with title Distortion Metrics vs. Input Attenuation, xlabel Input Attenuation (dB), ylabel Dynamic Range (dB) contains 3 objects of type line. These objects represent |THD|, SNR, SINAD.

그래프에는 각 메트릭에 대응하는 유용한 동적 범위가 나와 있습니다. THD의 크기는 고조파가 없는 범위에 해당합니다. 이와 유사하게 SNR은 잡음의 영향을 받지 않는 동적 범위에 해당하고, SINAD는 왜곡이 없는 총 동적 범위에 해당합니다.

그래프를 통해 알 수 있듯이, 입력 전력 감쇠가 증가하면 SNR이 저하됩니다. 이는 신호를 감쇠하면 신호만 감쇠되고, 증폭기의 바닥 잡음은 동일하게 유지되기 때문입니다.

또한 총 고조파 왜곡의 크기가 꾸준히 증가하다가 SNR 곡선과 교차한 후에는 측정값이 불안정해짐을 알 수 있습니다. 이는 고조파가 증폭기의 잡음 아래로 "사라졌기" 때문입니다.

증폭기의 증폭기 감쇠량은 26dB로 선택하는 것이 실용적입니다(SINAD는 103dB가 됨). 그러면 고조파 왜곡과 잡음 왜곡 간에 합리적으로 절충할 수 있습니다.

% Search the table for the largest SINAD reading
[maxSINAD, iAtten] = max(distortionTable(:,3));
fprintf('Max SINAD (%.1f dB) occurs at %.f dB attenuation\n', ...
  maxSINAD, iAtten)
Max SINAD (103.7 dB) occurs at 26 dB attenuation

감쇠기를 26dB로 설정하고 주기도를 플로팅해 보겠습니다.

inputVbestAtten = db2mag(-iAtten) * VmaxPk * sin(2*pi*Fi*t);
outputVbestAtten = helperHarmonicDistortionAmplifier(inputVbestAtten);
helperPlotPeriodogram(outputVbestAtten, Fs, 'power','annotate','shownoise');

Figure contains an axes object. The axes object with title Periodogram Power Spectrum Estimate, xlabel Frequency (kHz), ylabel Power (dB) contains 4 objects of type line, text. One or more of the lines displays its values using only markers

여기서 스펙트럼에 확산되어 있는 잡음 전력의 수준을 추가로 플로팅했습니다. 이 감쇠 설정에서 제2 고조파와 제3 고조파가 계속 스펙트럼에 표시되지만 총 잡음 전력보다 상당히 적습니다. 더 작은 대역폭의 가용 스펙트럼을 사용하는 애플리케이션에서는 감쇠를 더 크게 하여 고조파 성분을 줄일 수 있습니다.

후처리로 왜곡 제거하기

경우에 따라 증폭기의 비선형성을 어느 정도 보정할 수 있습니다. 증폭기의 출력값이 디지털화된 경우, 캡처된 출력값을 디지털 방식으로 후처리하고 비선형성을 수학적으로 해결함으로써 더 유용한 동적 범위를 복원할 수 있습니다.

이 예제에서는, 선형 램프 형태의 입력값을 가하고 해당 입력값에 가장 적합한 3차 다항식을 피팅합니다.

inputRamp = -2:0.00001:2;
outputRamp = helperHarmonicDistortionAmplifier(inputRamp);
polyCoeff = polyfit(outputRamp,inputRamp,3)
polyCoeff = 1×4

    0.0010   -0.0002    1.0000   -0.0250

이제 계수가 지정되었기 때문에, 출력값에 대해 사후 보정 작업을 수행하고 보정되지 않은 원래 출력값과 나란히 비교할 수 있습니다.

correctedOutputVmax = polyval(polyCoeff, outputVmax);

helperPlotPeriodogram([outputVmax; correctedOutputVmax],Fs,'power');
subplot(2,1,1)
title('Uncorrected')
subplot(2,1,2)
title('Polynomial Corrected')

Figure contains 2 axes objects. Axes object 1 with title Uncorrected, xlabel Frequency (kHz), ylabel Power (dB) contains an object of type line. Axes object 2 with title Polynomial Corrected, xlabel Frequency (kHz), ylabel Power (dB) contains an object of type line.

다항식 보정을 사용한 경우에 제2 고조파와 제3 고조파가 상당히 줄어들었습니다.

보정된 출력값을 사용하여 다시 측정해 보겠습니다.

thdCorrectedVmax = thd(correctedOutputVmax, Fs)
thdCorrectedVmax = -99.6194
snrCorrectedVmax = snr(correctedOutputVmax, Fs)
snrCorrectedVmax = 130.7491
sinadCorrectedVmax = sinad(correctedOutputVmax, Fs)
sinadCorrectedVmax = 99.6162

SINAD(및 THD)는 60dB에서 99dB로 떨어진 반면, SNR은 원래대로 131dB을 유지하고 있음을 알 수 있습니다.

여러 기법을 함께 사용하기

감쇠와 다항식 계산을 함께 사용하여, 시스템의 전반적인 SINAD를 최소화하는 이상적인 동작 전압을 찾을 수 있습니다.

subplot(1,1,1)
% Add three more columns to our distortion table
distortionTable = [distortionTable zeros(nReadings,3)];
for i = 1:nReadings
  inputVreduced = db2mag(-i) * VmaxPk * sin(2*pi*Fi*t);
  outputVreduced = helperHarmonicDistortionAmplifier(inputVreduced);
  correctedOutput = polyval(polyCoeff, outputVreduced);
  distortionTable(i,4:6) = [abs(thd(correctedOutput, Fs))
                            snr(correctedOutput, Fs)
                            sinad(correctedOutput, Fs)];
end

h = plot(distortionTable)
h = 
  6x1 Line array:

  Line
  Line
  Line
  Line
  Line
  Line

xlabel('Input attenuation (dB)')
ylabel('Dynamic Range (dB)')
for i = 1:3
  h(i+3).Color = h(i).Color;
  h(i+3).LineStyle = '--' ;
end
legend('|THD| (uncorrected)','SNR (uncorrected)','SINAD (uncorrected)', ...
 '|THD| (corrected)','SNR (corrected)','SINAD (corrected)','Location','best')
title('Distortion Metrics vs. Input Attenuation and Polynomial Correction');

Figure contains an axes object. The axes object with title Distortion Metrics vs. Input Attenuation and Polynomial Correction, xlabel Input attenuation (dB), ylabel Dynamic Range (dB) contains 6 objects of type line. These objects represent |THD| (uncorrected), SNR (uncorrected), SINAD (uncorrected), |THD| (corrected), SNR (corrected), SINAD (corrected).

여기서, 보정되지 않은 증폭기와 다항식 보정을 거친 증폭기 모두에 대해 세 개 메트릭을 나란히 모두 플로팅했습니다.

그래프에서 알 수 있듯이, THD는 상당히 개선된 반면 SNR은 다항식 보정의 영향을 받지 않았습니다. 이는 예상된 결과로, 다항식 보정이 고조파 왜곡에만 영향을 주고 잡음 왜곡에는 영향을 주지 않기 때문입니다.

다항식으로 보정된 경우에 가능한 SINAD 최댓값은 다음과 같습니다.

[maxSINADcorrected, iAttenCorr] = max(distortionTable(:,6));
fprintf('Corrected:    Max SINAD (%.1f dB) at %.f dB attenuation\n', ...
  maxSINADcorrected, iAttenCorr)
Corrected:    Max SINAD (109.7 dB) at 17 dB attenuation

다항식 보정을 거친 증폭기의 증폭기 감쇠량은 20dB로 선택하는 것이 좋습니다(SINAD는 109.8dB가 됨).

% Recompute amplifier at maximum SINAD attenuation setting with polynomial
inputVreduced = db2mag(-iAttenCorr) * VmaxPk * sin(2*pi*Fi*t);
outputVreduced = helperHarmonicDistortionAmplifier(inputVreduced);
correctedOutputVbestAtten = polyval(polyCoeff, outputVreduced);

helperPlotPeriodogram(correctedOutputVbestAtten, Fs, 'power','annotate','shownoise');
title('Periodogram of attenuated and polynomial corrected amplifier')

Figure contains an axes object. The axes object with title Periodogram of attenuated and polynomial corrected amplifier, xlabel Frequency (kHz), ylabel Power (dB) contains 4 objects of type line, text. One or more of the lines displays its values using only markers

제2 고조파를 제외한 모든 고조파가 다항식 보정으로 인해 이상적인 감쇠 설정 아래로 완전히 사라졌음을 알 수 있습니다. 앞서 언급한 것처럼, 제2 고조파는 총 바닥 잡음의 전력 수준 바로 아래에 나타납니다. 따라서 증폭기의 전체 대역폭을 사용하는 응용 사례에서 합리적인 상호 절충이 이루어집니다.

요약

왜곡 현상이 발생하는 증폭기의 출력값에 다항식 보정을 적용하는 방법과 합리적인 감쇠량 값을 선택하여 고조파 왜곡의 영향을 줄이는 방법에 대해 살펴보았습니다.

참고 항목

| |