want to remove extra data in fft data set
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
i have a current and diffrentioan dat form of magnetic field. those have some extra unwanted error in them. so by doing fft i wnat to remove them.
1 comentario
Respuestas (1)
Pooja Kumari
el 8 de Feb. de 2024
Hello ambesh,
I think you wanted to remove the extra unwanted error by using fft function.
You can refer to the below code for your reference:
% Assuming you have your current and differential data in vectors
current_data = []; % Your current data
diff_data = []; % Your differential data
% Perform FFT
current_fft = fft(current_data);
diff_fft = fft(diff_data);
% Determine the frequencies for each bin
n = length(current_data); % Assuming current and diff data are the same length
Fs = 1000; % Your data's sample rate in Hz
freqs = (0:n-1)*(Fs/n);
% Apply filter by setting unwanted frequencies to zero
cutoff_frequency = 50; % I have taken Low-pass filter
% Create a mask for frequencies that are within the desired range
mask = (freqs < cutoff_frequency) | (freqs > (Fs - cutoff_frequency)); % Low-pass filter mask
% Apply the mask to the FFT data by element-wise multiplication
filtered_current_fft = current_fft .* mask;
filtered_diff_fft = diff_fft .* mask;
% Perform the inverse FFT to get the cleaned up signal
cleaned_current_data = real(ifft(filtered_current_fft));
cleaned_diff_data = real(ifft(filtered_diff_fft));
You can refer to the following documentation for more information on fft function:
0 comentarios
Ver también
Categorías
Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!