Skip to content

Instantly share code, notes, and snippets.

@pikipity
pikipity / fft_plot.m
Created November 27, 2013 01:54
plot fft result in Matlab
function [ frequency,fft_result ] = fft_plot( data,Fs,varargin )
% Calculate or plot directly fft results of data.
%
% [ frequency,fft_result ] = fft_plot( data,Fs,'plot' )
%
% inputs:
% (1) data: data used to analysis. one row -> one data
% (2) Fs: sample frequency
% (3) 'plot': veriable input. if there is not this input, fft results will not be
% ploted
% signal -> x
%begin
fs=600;
Ts=1/fs;
t=1:length(x);
t=(t-1).*Ts;
%figure('name','original signal');plot(t,x)
%IMF=eemd_test(x); %try to use eemd to calculate IOF
IMF=emd(x);
% original signal
function [ newindmin newindmax newindzer ] = refresh_index( x,indmin,indmax,indzer )
% Find the new indmin, indmax and inzer
%clear result
newindmin=[];
newindmax=[];
newindzer=[];
%find new indzer
for n=1:length(indzer)
function [f,t,f_GZC]=Instaneous_Frequency_Test(x,fs)
% [f,t]=Instaneous_Frequency_Test(x,fs)[f,t]=Instaneous_Frequency_Test(x,fs)
% x is the signal that will be analysised.
% fs is the sampling frequency
% f is the instaneous frquency
% t is the time range of each instaneous frequency
% f_GZC is the mean frequency
%the length of x must be larger than 8
if length(x)<8
function [ XPhase,f,Imag,t,f_OGZ,maxf_emdvalue ]=IF_hilbert(x,fs)
%x is the signal that will be analysised
%fs is sample frequency
%XPhase is instanepus phase
%f is instaneous phase
%t is the time string
%f_OGZ is the mean frequency
%maxf_emdvalue is the frequency whose property is maximum.
if length(x)<2
@pikipity
pikipity / gist:5010379
Created February 22, 2013 02:52
pikipity 的 _config.yml
# ----------------------- #
# Main Configs #
# ----------------------- #
url: http://pikipity.github.com
title: 折腾来折腾去
subtitle: pikipity的blog
time: 2013-01-30
author: pikipity
self_introduction: