Isolating a single pulse by removing noise
10 次查看(过去 30 天)
显示 更早的评论
I hope my title wasn't misleading, I simply want to remove the oscillatory noise from the pulse I obtain from a monostable multivibrator.
I have attached a picture of the Time Domain waveform (which is the same as the snapshot from the o-scope) below, I want to isolate the 50ns initial pulse. I am thinking of using a low-pass filter to achieve that but inorder to do so I need to find the frequencies of the noise.
I converted the time domain waveform using FFT Spectral Analysis https://www.mathworks.com/help/matlab/math/fft-for-spectral-analysis.html;jsessionid=bc43693596ebb77a7d9866ab030f
And I have attached the plots for the Frequency Domain graphs that I obtained after using FFT.
zoomed into the range of 0~20 Hz
I am having a hard time identifying which frequencies are from the noise and which frequency is that of the 50ns initial pulse that I am interested in, so I can find the ideal resistor-capacitor combination for the low pass filter to isolate the pulse from the noise
Any help would be greatly appreciated. I have attached the CSV file I obtained from the o-scope and my code incase that helps.
Thanks in advance!
clc; clear all; close all
A = dlmread("F0000CH1.CSV",",",0,3);
Time = 1e9.*A(:,1);
Voltage = A(:,2);
figure
plot(Time,Voltage,'LineWidth',2)
title('Time Domain Function')
ylabel('Voltage (V)')
xlabel('Time (ns)')
xlim([-125 400])
ylim([-4.5 6])
%frequency domain
S=numel(Time);
FFT = fft(Voltage,S);
Pyy = FFT.*conj(Voltage)/S;
f = (1000/S)*(0:floor(S/2));
figure
plot(f,Pyy(1:floor(S/2)+1))
title('Frequency Domain')
xlabel('Frequency (Hz)')
ylabel('dB/frequency')
figure
plot(f(1:50),Pyy(1:50),'LineWidth',2)
title('Frequency Domain')
xlabel('Frequency (Hz)')
ylabel('dB/frequency')
0 个评论
采纳的回答
Star Strider
2019-9-13
Try this:
A = dlmread('F0000CH1.csv',",",0,3);
Time = 1e9.*A(:,1);
Voltage = A(:,2);
figure
plot(Time,Voltage,'LineWidth',2)
title('Time Domain Function')
ylabel('Voltage (V)')
xlabel('Time (ns)')
xlim([-125 400])
ylim([-4.5 6])
L = numel(Time); % Signal Length
Ts = mean(diff(Time)); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
FT_V = fft(Voltage)/L; % Normalised Fourier Transform
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
plot(Fv, abs(FT_V(Iv))*2)
grid
xlim([0 0.5])
Wp = 0.045; % Passband Frequency (Normalised)
Ws = 0.050; % Stopband Frequency (Normalised)
Rp = 1; % Passband Ripple
Rs = 50; % Passband Ripple (Attenuation)
[n,Wp] = ellipord(Wp,Ws,Rp,Rs); % Elliptic Order Calculation
[z,p,k] = ellip(n,Rp,Rs,Wp); % Elliptic Filter Design: Zero-Pole-Gain
[sos,g] = zp2sos(z,p,k); % Second-Order Section For Stability
figure
freqz(sos, 2^16, Fs) % Filter Bode Plot
Voltage_filt = filtfilt(sos, g, Voltage); % Filter Signal
figure
plot(Time,Voltage_filt,'LineWidth',2)
title('Time Domain Function')
ylabel('Voltage (V)')
xlabel('Time (ns)')
xlim([-125 400])
ylim([-4.5 6])
I chose a passband frequency of 0.045 Hz and a stopband frequency of 0.050 Hz, based on the Fourier transform results, since it appeared to give good results. This code designs an 7-order elliptic filter, since these filters are efficient. Experiment with the filter characteristics to decide on the paramerers for your hardware filter.
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Filter Analysis 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!