Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab FFT for Varying Signal Frequency

Status
Not open for further replies.

swhansen

Newbie level 1
Joined
Dec 7, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
Hi all,
I am trying to complete a FFT analysis for Temperature vs. time data recorded via a thermocouple. Instead of a constant recording frequency of 100Hz, the signal alternates betwen 100Hz (one sample per 10ms) and 90Hz (one sample per 11ms). Because of this, is it possible to complete an FFT? Temp and time data are the same length.

Here is the code I am writing....


time=xlsread(spreadsheet, sheetname, range_1); %% Load temp data
T_t=xlsread(spreadsheet, sheetname, range_2); %% Load Temp data

Xf=fft(T_t); %% FFT of Temp
mag=abs(Xf); %% absolute value of FFT
phase=angle(Xf)*360/(2*pi);
fs=100; %% Unsure what to use here
N=length(time); %% Length of data
f=(1:N)*fs/N; %% Frequency, again, unsure what to use here for
semilogy(f, mag);



Any comments/thoughts are very helpful!

Thanks!

-Scott
 

Make sure the correct section before posting

Post is moved - DSP section
 

Heya Scott - unevenly sampled data is a turd!

Two options spring to mind:

1. Resample the data onto a 1ms grid and go from there, or
2. Use spectral estimation techniques that don't rely on regular sampling, such as the Lomb-Scargle periodogram described in Numerical Recipes (**broken link removed**). I see someone has kindly written a function for MATLAB already! (lombscargle.m - File Exchange - MATLAB Central :)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top