problem with fdesign.fracdelay
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I have a 50Hz sinusoidal signal - call this as expected signal (Ir).
I have another signal, same as above but shifted by 5 degree - call this as corrupted signal (Ir_Err).
What I want to do is that, I apply fracdelay filter to the corrupted signal in order to obtain expected signal from the corrupted one (Ir_Filtered).
I used the below code in the simplest form. But what I get is same as corrupted signal after removing group delay of fracdelay filter.
fs = 976; % sample frequency in Hz
f = 50; % line frequency in Hz
sim_time = 0.05; % in sec
CT_PHASE_ERROR = 5; % in degree
n = 0:(sim_time*fs)-1;
Ir = sin(2*pi*f*n/fs); % expected signal
Ir_Err = sin(2*pi*f*n/fs + deg2rad(CT_PHASE_ERROR)); % phase shifted signal to be compansated
delay = (CT_PHASE_ERROR/360)/f; % Fractional Delay to be compensated in sec
filter_order = 6; % Order
h = fdesign.fracdelay(delay, 'N', filter_order, fs);
Hd = design(h, 'lagrange', 'filterstructure', 'farrowfd');
Ir_Filtered = circshift(filter(Hd, Ir_Err), [0 -3]); % remove group delay of fracdelay filter
plot(n, Ir,...
n, Ir_Err,...
n, Ir_Filtered);
legend('Ir Expected', 'Ir Err', 'Ir Filtered');
Below plot, blue and yellow lines should match but instead yellow overlaps with the red.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152879/image.png)
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Filter Design에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!