Amplitude Increase when using bandpass filter

Hello,
I am trying to filter "Signal" (I attached only cell {1, 4} as the rest of the cell data is too large to attach here) using an appropriate filter. The frequency of the excited wave is 50 kHz, and the sampling frequency of the received wave is 60 MHz. I used a lowpass filter, with fpass as 5e4, fs as 6e7, and the signal returns as smooth and undistorted.`
I also attempted to use a bandpass filter, with upper and lower bands as 6e4 and 4e4 respectively, so as to try and keep the band close to 50 kHz. The high frequency oscillations are removed, but the signal returns is also distorted. Why is that? Any problems in my code? In addition, is my implementation valid, in both the lowpass filter and bandpass filter? What filter should I use, and why?
actuator = 1;
sensor = 4;
dt = 1.6667e-8;
endTime = 500e-6;
t = 0:dt:endTime;
fs = 6e7;
fpass = 5e4;
%%
a = Signal{actuator, sensor}(:, sensor);
for i = 1:1:10
Signal{actuator, sensor}(:, i) = Signal{actuator, sensor}(:, i) - Signal{actuator, sensor}(actuator, i);
end
a_filtered = bandpass(Signal{actuator, sensor}, [40000 60000], fs);
%a_filtered = lowpass(mean(Signal{Actuator, Sensor}, 2), fpass, Fs);
figure;
plot(t, a, '-r')
hold on
plot(t, a_filtered, '-b')
ylabel('Signal (V)')
xlabel('Time (s)')
title('50 kHz')

 採用された回答

Angelo Yeo
Angelo Yeo 2023 年 11 月 16 日

1 投票

Can you clarify what you mean by "distorted"? I think the filter works well. I don't understand what you mean by "distorted".
load("Signal.mat")
dt = 1.6667e-8;
endTime = 500e-6;
t = 0:dt:endTime;
fs = 6e7;
fpass = 5e4;
%%
bandpass(Signal1(:, 1), [40, 60] * 1e3, fs)
P.S. Nice nickname though :p

4 件のコメント

Haha Hahaha
Haha Hahaha 2023 年 11 月 16 日
編集済み: Haha Hahaha 2023 年 11 月 16 日
I mean, is it expected that amplitude increases, after filtering, as shown above in some parts of the signal? I would expect that maybe it will decrease, but not increase? That's what I mean by the distortion I am concerned about.
Ps.Do you mind sharing the code snippet for the power spectrum? I want to know how to do it
Angelo Yeo
Angelo Yeo 2023 年 11 月 16 日
  1. The amplitude didn't increase. It may have decreased. I bet it's the phase that changed. As you know, for example, the amplitude of the sine signal is 1. But, thinking about the phase, it changes over the phase and the signal value can be even 0 at specific time point. That is where phase change can affect the signal value of the result signal at specific time.
  2. You don't need any more code. The bandpass itself prints out the power spectrum plot, too. You can run the script I provided as is.
Haha Hahaha
Haha Hahaha 2023 年 11 月 17 日
In addition, how do I deduce from the power spectrum plot, that the signal has been successfully filtered/denoised?
Angelo Yeo
Angelo Yeo 2023 年 11 月 17 日
I would say "visually" first. In your example, the signal is mainly of under 1MHz component so it's hard to know if it's filtered well or not. However, in some cases, you can understand the result from power spectrum. See the example below, and you can clearly see that the signal is filtered as expected.
fs = 1e3;
t = 0:1/fs:1;
x = [2 1 2]*sin(2*pi*[50 150 250]'.*t) + randn(size(t))/10;
bandpass(x,[100 200],fs)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品

リリース

R2023b

質問済み:

2023 年 11 月 16 日

コメント済み:

2023 年 11 月 17 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by