Clear Filters
Clear Filters

i have written code for fft and hilbert transform matlab code pls help me

1 view (last 30 days)
%(A)FFT AND HILBERT function [Hilb, Env] = envelope(D8,Freq) %Read in Data from Text file fileID = fopen('good bearing frequency domain_5.lvm'); signal = cell2mat(textscan(fileID, '%f32')); fclose(fileID); %End of Data Read clc; close all; %Normal FFT Fs=256000; y=signal; N=256000; T=N/Fs; sig_f=abs(fft(y(1:N)',N)); sig_n=sig_f/(norm(sig_f)); freq_s=(0:N-1)/T; clc; close all; %Envelope Detection using Hilbert Transform and Fast Fourier Transform analy = hilbert(signal); %Hilbert transform on imported data Hilb = abs(analy); N = length(signal) Freq=256000; T = N/Freq; sig_f=abs(fft(Hilb(1:N)',N)); Env=sig_f/(norm(sig_f)); freq_s=(0:N-1)/T; figure(gcf); clf subplot(211);plot(freq_s(2:250),sig_n(2:250));title('FFT of Original Signal');legend('Fast Fourier Transform');xlabel('Time(s)');ylabel('Magnitude') grid on subplot(212);plot(freq_s(2:250),Env(2:250));title('Envelope Detection : Hilbert Transform');legend('Hilbert Transform');xlabel('Frequency(Hz)');ylabel('Signal Amplitude') grid on end

Answers (0)

Community Treasure Hunt

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

Start Hunting!