Main Content

올림 코사인 필터링

이 예제에서는 올림 코사인 필터의 심볼간 간섭(ISI) 제거 기능과, 올림 코사인 송신 필터 및 수신 필터 System object를 사용하여 송신기와 수신기 간에 올림 코사인 필터링을 분리하는 방법을 보여줍니다.

올림 코사인 필터 사양

올림 코사인 필터의 기본 파라미터는 필터의 대역폭을 간접적으로 지정하는 롤오프 인자입니다. 이상적인 올림 코사인 필터의 탭 개수는 무한합니다. 따라서 실제 올림 코사인 필터에는 윈도우가 적용됩니다. 윈도우 길이는 FilterSpanInSymbols 속성을 사용하여 제어됩니다. 이 예제에서는 필터가 6개의 심볼 지속 시간에 걸쳐 있기 때문에 윈도우 길이를 6개의 심볼 지속 시간으로 지정합니다. 이러한 필터는 3개 심볼 지속 시간의 군지연도 갖습니다. 올림 코사인 필터는 신호가 업샘플링되는 펄스 성형에 사용됩니다. 따라서 업샘플링 인자도 지정해야 합니다. 이 예제에서는 올림 코사인 필터를 설계하는 데 다음 파라미터를 사용합니다.

Nsym = 6;           % Filter span in symbol durations
beta = 0.5;         % Roll-off factor
sampsPerSym = 8;    % Upsampling factor

올림 코사인 송신 필터 System object™를 만들고 그 속성을 설정하여 원하는 필터 특성을 얻습니다. impz를 사용하여 필터 특성을 시각화합니다.

rctFilt = comm.RaisedCosineTransmitFilter(...
  Shape='Normal', ...
  RolloffFactor=beta, ...
  FilterSpanInSymbols=Nsym, ...
  OutputSamplesPerSymbol=sampsPerSym)
rctFilt = 
  comm.RaisedCosineTransmitFilter with properties:

                     Shape: 'Normal'
             RolloffFactor: 0.5000
       FilterSpanInSymbols: 6
    OutputSamplesPerSymbol: 8
                      Gain: 1

% Visualize the impulse response
impz(rctFilt.coeffs.Numerator)

Figure contains an axes object. The axes object with title Impulse Response, xlabel n (samples), ylabel Amplitude contains an object of type stem.

이 객체는 단위 에너지를 갖는 Direct-Form 다상 FIR 필터를 설계합니다. 이 필터의 차수는 Nsym*sampsPerSym입니다(혹은 Nsym*sampsPerSym+1 개의 탭을 가집니다). Gain 속성을 활용하여 필터 계수를 정규화하여 필터링된 데이터와 필터링되지 않은 데이터를 중첩했을 때 두 데이터가 일치하도록 할 수 있습니다.

% Normalize to obtain maximum filter tap value of 1
b = coeffs(rctFilt);
rctFilt.Gain = 1/max(b.Numerator);

% Visualize the impulse response
impz(rctFilt.coeffs.Numerator)

Figure contains an axes object. The axes object with title Impulse Response, xlabel n (samples), ylabel Amplitude contains an object of type stem.

올림 코사인 필터로 펄스 성형

양극성 데이터 시퀀스를 생성하고 올림 코사인 필터를 사용하여 ISI가 없는 파형을 성형합니다.

% Parameters
DataL = 20;             % Data length in symbols
R = 1000;               % Data rate
Fs = R * sampsPerSym;   % Sampling frequency

% Create a local random stream to be used by random number generators for
% repeatability
hStr = RandStream('mt19937ar',Seed=0);

% Generate random data
x = 2*randi(hStr,[0 1],DataL,1)-1;
% Time vector sampled at symbol rate in milliseconds
tx = 1000 * (0: DataL - 1) / R;

플롯에서 디지털 데이터와 보간된 신호를 비교합니다. 필터의 피크 응답이 필터의 군지연(Nsym/(2*R))에 의해 지연되기 때문에 두 신호를 비교하기가 어렵습니다. 여기서는 입력값 x 끝에 Nsym/2개의 0을 추가하여 모든 유용한 샘플을 필터에서 플러시합니다.

% Filter
yo = rctFilt([x; zeros(Nsym/2,1)]);
% Time vector sampled at sampling frequency in milliseconds
to = 1000 * (0: (DataL+Nsym/2)*sampsPerSym - 1) / Fs;
% Plot data
fig1 = figure;
stem(tx, x, 'kx'); hold on;
% Plot filtered data
plot(to, yo, 'b-'); hold off;
% Set axes and labels
axis([0 30 -1.7 1.7]);  xlabel('Time (ms)'); ylabel('Amplitude');
legend('Transmitted Data','Upsampled Data','Location','southeast')

Figure contains an axes object. The axes object with xlabel Time (ms), ylabel Amplitude contains 2 objects of type stem, line. These objects represent Transmitted Data, Upsampled Data.

입력 신호를 지연시켜 올림 코사인 필터 군지연을 보정합니다. 이제 올림 코사인 필터가 어떻게 신호를 업샘플링하고 필터링하는지 쉽게 볼 수 있습니다. 필터링된 신호가 입력 샘플 시간에서 지연된 입력 신호와 동일합니다. 따라서 올림 코사인 필터가 신호 대역을 제한하면서 동시에 ISI를 방지할 수 있다는 것을 보여줍니다.

% Filter group delay, since raised cosine filter is linear phase and
% symmetric.
fltDelay = Nsym / (2*R);
% Correct for propagation delay by removing filter transients
yo = yo(fltDelay*Fs+1:end);
to = 1000 * (0: DataL*sampsPerSym - 1) / Fs;
% Plot data.
stem(tx, x, 'kx'); hold on;
% Plot filtered data.
plot(to, yo, 'b-'); hold off;
% Set axes and labels.
axis([0 25 -1.7 1.7]);  xlabel('Time (ms)'); ylabel('Amplitude');
legend('Transmitted Data','Upsampled Data','Location','southeast')

Figure contains an axes object. The axes object with xlabel Time (ms), ylabel Amplitude contains 2 objects of type stem, line. These objects represent Transmitted Data, Upsampled Data.

롤오프 인자

롤오프 인자를 0.5(파란색 곡선)에서 0.2(빨간색 곡선)로 변경했을 때 필터링된 출력에 미치는 영향을 확인해 봅니다. 롤오프 값이 낮을수록 필터의 천이 대역이 좁아지기 때문에 필터링된 신호의 오버슈트가 파란색 곡선보다 빨간색 곡선에서 더 큽니다.

% Set roll-off factor to 0.2
rctFilt2 = comm.RaisedCosineTransmitFilter(...
  Shape='Normal', ...
  RolloffFactor=0.2, ...
  FilterSpanInSymbols=Nsym, ...
  OutputSamplesPerSymbol=sampsPerSym);
% Normalize filter
b = coeffs(rctFilt2);
rctFilt2.Gain = 1/max(b.Numerator);
% Filter
yo1 = rctFilt2([x; zeros(Nsym/2,1)]);
% Correct for propagation delay by removing filter transients
yo1 = yo1(fltDelay*Fs+1:end);
% Plot data
stem(tx, x, 'kx'); hold on;
% Plot filtered data
plot(to, yo, 'b-',to, yo1, 'r-'); hold off;
% Set axes and labels
axis([0 25 -2 2]);  xlabel('Time (ms)'); ylabel('Amplitude');
legend('Transmitted Data','beta = 0.5','beta = 0.2',...
    'Location','southeast')

Figure contains an axes object. The axes object with xlabel Time (ms), ylabel Amplitude contains 3 objects of type stem, line. These objects represent Transmitted Data, beta = 0.5, beta = 0.2.

제곱근 올림 코사인 필터

올림 코사인 필터링은 일반적으로 송신기와 수신기 간에 필터링을 분리하는 데 사용됩니다. 송신기와 수신기 모두 제곱근 올림 코사인 필터를 사용합니다. 송신기 필터와 수신기 필터를 결합한 것이 올림 코사인 필터이기 때문에 최소한의 ISI가 발생합니다. 형태를 'Square root'로 설정하여 제곱근 올림 코사인 필터를 지정합니다.

% Design raised cosine filter with given order in symbols
rctFilt3 = comm.RaisedCosineTransmitFilter(...
  Shape='Square root', ...
  RolloffFactor=beta, ...
  FilterSpanInSymbols=Nsym, ...
  OutputSamplesPerSymbol=sampsPerSym);

설계된 필터를 사용하여 데이터 스트림이 송신기에서 업샘플링되고 필터링됩니다. 다음 플롯은 제곱근 올림 코사인 필터를 사용하여 필터링해서 송신된 신호를 보여줍니다.

% Upsample and filter.
yc = rctFilt3([x; zeros(Nsym/2,1)]);
% Correct for propagation delay by removing filter transients
yc = yc(fltDelay*Fs+1:end);
% Plot data.
stem(tx, x, 'kx'); hold on;
% Plot filtered data.
plot(to, yc, 'm-'); hold off;
% Set axes and labels.
axis([0 25 -1.7 1.7]);  xlabel('Time (ms)'); ylabel('Amplitude');
legend('Transmitted Data','Sqrt. Raised Cosine','Location','southeast')

Figure contains an axes object. The axes object with xlabel Time (ms), ylabel Amplitude contains 2 objects of type stem, line. These objects represent Transmitted Data, Sqrt. Raised Cosine.

송신된 신호(자홍색 곡선)는 수신기에서 필터링됩니다. 전체 파형을 표시하기 위해 필터 출력을 데시메이션하지 않았습니다. 디폴트 단위 에너지 정규화를 수행하면 송신 필터와 수신 필터를 결합한 이득이 정규화된 올림 코사인 필터의 이득과 동일하게 됩니다. (수신기에서 파란색 곡선으로 표시된) 필터링된 수신 신호가 하나의 올림 코사인 필터를 사용하여 필터링된 신호와 거의 동일합니다.

% Design and normalize filter.
rcrFilt = comm.RaisedCosineReceiveFilter(...
  'Shape',                  'Square root', ...
  'RolloffFactor',          beta, ...
  'FilterSpanInSymbols',    Nsym, ...
  'InputSamplesPerSymbol',  sampsPerSym, ...
  'DecimationFactor',       1);
% Filter at the receiver.
yr = rcrFilt([yc; zeros(Nsym*sampsPerSym/2, 1)]);
% Correct for propagation delay by removing filter transients
yr = yr(fltDelay*Fs+1:end);
% Plot data.
stem(tx, x, 'kx'); hold on;
% Plot filtered data.
plot(to, yr, 'b-',to, yo, 'm:'); hold off;
% Set axes and labels.
axis([0 25 -1.7 1.7]);  xlabel('Time (ms)'); ylabel('Amplitude');
legend('Transmitted Data','Rcv Filter Output', ...
    'Raised Cosine Filter Output','Location','southeast')

Figure contains an axes object. The axes object with xlabel Time (ms), ylabel Amplitude contains 3 objects of type stem, line. These objects represent Transmitted Data, Rcv Filter Output, Raised Cosine Filter Output.

계산 비용

다음 표에서는 다상 FIR 보간 필터와 다상 FIR 데시메이션 필터의 계산 비용을 비교합니다.

C1 = cost(rctFilt3);
C2 = cost(rcrFilt);
------------------------------------------------------------------------
                    Implementation Cost Comparison
------------------------------------------------------------------------
                        Multipliers  Adders  Mult/Symbol  Add/Symbol
Multirate Interpolator      49         41          49         41
Multirate Decimator         49         48           6.125      6