Conversion from FFT to IFFT
조회 수: 35 (최근 30일)
이전 댓글 표시
Hi,
I have a seismic signal that I have ran thorugh Transfer Functions, with converting it from time-domain to frequency domain using FFT function. Once the transfer functions have been applied, I have tried to bring the signal back to time domain to IFFT, but I am getting only the upper half of the signal (picture attached). Please dont mind the big peak at the end, still need to remove the noise.
G = ifft(Y_corr);
figure
plot(abs(G))
Y_corr is the seismic signal after transfer functions, which needs to be brougth back in time domain. How can I seperate the upper and lower halves of the signal, since "abs" is not really doing that?
Thank You!!!
댓글 수: 0
답변 (1개)
Star Strider
2022년 11월 12일
It is likely not efficient to do filtering by editing the fft result (although it can be done). If you want to do it that way, the easiest way is to use the fftshift function to create a symmetrical (positive and negative frequency) version of the Fourier transform. Then, apply the ideal filter (or whatever filter you have available) to both sides of the two-sided Fourier transform. After that, apply ifftshift and then take the ifft of that vector.
The shifts would go something like this —
v = 1:9
v1 = fftshift(v)
v2 = ifftshift(v1)
Experiment with those functions to understand how they work.
However, that is definitely the long way around. Instead, if you want to pass only a range of frequencies, use the bandpass function. (For best results, include the 'ImpulseResponse','iir' name value pair to design an efficient elliptic filter.) There are other ways to design filters if you have the Signal Processing Toolbox and do not have the bandpass function. I will help with that if necessary.
.
댓글 수: 11
Star Strider
2022년 11월 14일
With the sampling frequency provided —
s = tf('s'); % <— CHANGED
R_g = 1800; % coil resistance [ohms]
R_s = 2680; % damping resistance [ohms]
G_1 = 175; % generator constant of the magnet-coil system [V/(m/s^2)]
G_2 = 23700; % pre-amplifier gain
omega_b = 0.31416; % output high pass cut-off angular frequency (rad./s)
omega_p = 57.1199; % output low pass cut-off angular frequency (rad./s)
f_0 = 1; % responant frequency of the pendulum (Hz)
h = 0.85; % damping constant
S_R = 53; % sampling rate, nominal (Hz)
omega_0 = 2*pi*f_0;
K = 204.8;
% Resistance ratio of the damping circuit
% G = R_s./(R_g + R_s);
% % Transfer function of the seismometer for accleration
% S_p = s./(s.^2 + 2.*h.*omega_0.*s + omega_0.^2);
% % Transfer function of 8-pole output low-pass anti-aliasing filter
% F_l = ([omega_p.^2./(s.^2 + 2.*cos(pi/8).*(omega_p).*s + (omega_p).^2)].^2 ).* [omega_p.^2./(s.^2 + 2.*cos((3*pi)/8).*(omega_p).*s + (omega_p).^2)].^2;
% % Transfer function of single-pole high-pass filter in the output amplifier
% F_a = s./(omega_b + s);
% % Seismometer response for acceleration in flat-response mode
% A_SP = K.*G.*G_1.*G_2.*S_p.*F_a.*F_l; %units V./(m./s.^2)
% s = tf('s');
Ts = 1/53; % Sampling Period
G = R_s/(R_g + R_s);
S_p = s/(s^2 + 2*h*omega_0*s + omega_0^2);
S_pz = c2d(S_p, Ts)
figure
bodeplot(S_p)
grid
F_l = ([omega_p^2/(s^2 + 2*cos(pi/8)*(omega_p)*s + (omega_p)^2)]^2 )* [omega_p^2/(s^2 + 2*cos((3*pi)/8)*(omega_p)*s + (omega_p)^2)]^2;
F_lz = c2d(F_l, Ts)
figure
bodeplot(F_l)
grid
F_a = s/(omega_b + s);
F_az = c2d(F_a, Ts)
figure
bodeplot(F_a)
grid
A_SP = K*G.*G_1*G_2*S_p*F_a*F_l;
A_SPz = c2d(A_SP, Ts)
figure
bodeplot(A_SP)
grid
b = A_SPz.Numerator
a = A_SPz.Denominator
Use ‘b’ and ‘a’ with the Signal processing Toolbox to filter the signals. It might be appropriate to use the tf2sos funciton to produce a stable filter from them, then use that result with filtfilt.
I do not understand what you intend by deconvolving them. My impression was always that you want to filter the signal with them. In any event, you can use these vectors with the deconv function if necessary, since they are now appropriate for a discrete signal.
.
참고 항목
카테고리
Help Center 및 File Exchange에서 Analog Filters에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!