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!