Decreasing bin size FFT options for increased resolution (2024)

20 views (last 30 days)

Show older comments

Kyle on 19 Apr 2024

  • Link

    Direct link to this question

    https://ms-www.mathworks.com/matlabcentral/answers/2109071-decreasing-bin-size-fft-options-for-increased-resolution

  • Link

    Direct link to this question

    https://ms-www.mathworks.com/matlabcentral/answers/2109071-decreasing-bin-size-fft-options-for-increased-resolution

Edited: Star Strider on 19 Apr 2024

Accepted Answer: Star Strider

  • datainquestion.mat

I have a data set sampled at 0.8Mhz that is an impact blast wave that has 6ms capture leading to about 5000 points of data. We are interested in doing an FFT to look at the frequency of the data set. However, due to the sameple rate and sameple length we only end up with 2500 points meaning our bins are ~160Hz bins, which does not carry enough data for our analysis we are interested in. Our team was exploring ways to increase the data content of the wave so we can increase the granulariuty of the frequency domain.

Our first idea which we wanted to check was if it was "ok" to copy and paste the data along the X axis in time so that we would not add any spectral leckage into the system while decrasing the bin size for increased resolution. I did not see many comments on this so I am not sure if this is taboo or not.

There is the option of zero padding but that leads to spectral leakage and due to the nature of this data, we are unsure if this is viable with the sinc(x) function being used for this.

The end goal is a PSD using pwelch or periodogram with a force-exponential window followed by a bode plot of magnitude and phase ( which I am also only seeing matlab functions to be used on transfer system functions and havnt found a way to perform on a raw data set.)

So I am looking for insights on how best to aproach this.

Decreasing bin size FFT options for increased resolution (2)

A follow up question that I was having a hard time understanding in my signals and systems textbooks that i have been harvesting info out of is whenyou do an fft, the data point that has the stem point ( in this case the first woud be 160Hz) is that the data in that exact frequency or is that a combination of all of the frequencies not reported after performing the transformation with bleed between the points.

Thank you for the help!

0 Comments

Show -2 older commentsHide -2 older comments

Sign in to comment.

Sign in to answer this question.

Accepted Answer

  • Link

    Direct link to this answer

    https://ms-www.mathworks.com/matlabcentral/answers/2109071-decreasing-bin-size-fft-options-for-increased-resolution#answer_1444551

  • Link

    Direct link to this answer

    https://ms-www.mathworks.com/matlabcentral/answers/2109071-decreasing-bin-size-fft-options-for-increased-resolution#answer_1444551

Edited: Star Strider on 19 Apr 2024

Open in MATLAB Online

  • datainquestion.mat

You can minimise the spectral leakage by windowing the fft (except for a rectangular window, which is the default if no others are chosen). Subtracting the mean from the signal before calculating the fft elimniates the D-C offset, making the other peaks more easily visible.

Most of the information is below 5 (Hz?), so I limited the frequency-domain plot to that range.

Try this —

LD = load('datainquestion.mat');

a = LD.a;

t = a(:,1) * 1E+3; % Time (Converted To milliseconds)

psi = a(:,2);

figure

plot(t, psi)

grid

xlabel('Time (ms)')

ylabel('Amplitude (units)')

Decreasing bin size FFT options for increased resolution (4)

L = size(a,1); % Signal Length

Ts = mean(diff(t)); % Sampling Interval

% Tsd = std(diff(x)) % Check Sampling Interval Variation

Fs = 1/Ts % Sampling Frequency

Fs = 0.8000

Fn = Fs/2; % Nyquist Frequency

NFFT = 2^(nextpow2(L)+6) % Length Of 'fft' (Integer Power-Of-2 Is Most Efficient)

NFFT = 524288

hw = hann(L); % Window Function

FTpsi = fft((psi - mean(psi)).*hw, NFFT)/sum(hw); % Calculate Windowed 'fft', Subtract Mean To Eliminate D-C Offset

Fv = Fs*(0:(NFFT/2))/NFFT; % Frequency Vector

Iv = 1:numel(Fv); % Index Vector

figure

plot(Fv, abs(FTpsi(Iv))*2)

grid

xlim([0 2.55E-3])

xlabel('Frequency (Hz)')

ylabel('Magnitude')

Decreasing bin size FFT options for increased resolution (5)

figure

plot(Fv, mag2db(abs(FTpsi(Iv))*2))

grid

xlabel('Frequency (Hz)')

ylabel('Power (dB)')

xlim([0 2.55E-3])

Decreasing bin size FFT options for increased resolution (6)

I’m not certain that this meets your requirements. It’s how I usually calculate the fft. (If you want the maximum to be at 0 dB, divide ‘abs(FTpsi))’ by ‘max(abs(FTpsi))’.)

EDIT — (19 Apr 2024 at 18:40)

Converted ‘x’ to ‘t’ and converted ‘t’ to milliseconds (multiplying it by 1E+3).

EDIT — (19 Apr 2024 at 19:00)

Changed the xlim range to [0 2.55E-3].

.

2 Comments

Show NoneHide None

Kyle on 19 Apr 2024

Direct link to this comment

https://ms-www.mathworks.com/matlabcentral/answers/2109071-decreasing-bin-size-fft-options-for-increased-resolution#comment_3137431

  • Link

    Direct link to this comment

    https://ms-www.mathworks.com/matlabcentral/answers/2109071-decreasing-bin-size-fft-options-for-increased-resolution#comment_3137431

Sweet. You got to this really fast!

But I do have some questions. 1st the time I posted, should have been labeled in ms. Because of that the Fs was only at 800 for the calcuations and not 800,000. Because we are working in a different time scale, and the frequency is dependent on the sampling rate, I assume it is important detail that I overlooked in my explaniation as the NFFT is only 16384.

In the way that you plotted it, is there any way to increase the quantaity of points between [0-2] which was the bulk of the question as you are spot on. The large % of the content is below 5KHz, we were interested in focusing our analysis on the 2KHz band but as we only have so few data points we found that challeneging.

2nd why did you use the mag2db function instead of a pwlech or a specogram function. I would tend to think all 3 do a similar task?

Thank you for the help as always.

Star Strider on 19 Apr 2024

Direct link to this comment

https://ms-www.mathworks.com/matlabcentral/answers/2109071-decreasing-bin-size-fft-options-for-increased-resolution#comment_3137511

  • Link

    Direct link to this comment

    https://ms-www.mathworks.com/matlabcentral/answers/2109071-decreasing-bin-size-fft-options-for-increased-resolution#comment_3137511

Thank you!

1. I just now converted the time units to milliseconds by multiplying them by Decreasing bin size FFT options for increased resolution (9).

The value for ‘NFFT’ can be arbitrarily large, depending on what you want, however it is always best to have it as an integer power-of-2. Indreasing it to:

NFFT = 2^(nextpow2(L)+6)

(equalling 524288) does not significantly improve the frequency resolution (visually) beyond just adding 2 to it instead of 6. It definitely increases the frequency resolution.

2. I used mag2db to convert the magnitude to power using the simple fft result. The other functions you mention, pwelch and spectrogram, calculate and plot the power as power spectral density, or dB/Hz. My plot data are simply dB without converting to spectral density. (This is the same result that the pspectrum funciton would provide.) I find this more intuitive, so simply a personal preference. You are of course free to use whatever functions you want.

My pleasure!

.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

See Also

Categories

Signal ProcessingSignal Processing ToolboxSpectral AnalysisSpectral Estimation

Find more on Spectral Estimation in Help Center and File Exchange

Tags

  • fft
  • spectral leakage
  • signal processing

Community Treasure Hunt

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

Start Hunting!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.


Decreasing bin size FFT options for increased resolution (10)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom(English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

Decreasing bin size FFT options for increased resolution (2024)
Top Articles
OLX.bg - безплатни обяви
Boom - FlyBy - Live Blog: Overture Superfactory Construction Progression
Lesson 10 Homework 5.3
Savory Dishes Made Simple: 6 Ingredients to Kick Up the Flavor - MSGdish
Car Parts Open Now
Understanding Filmyzilla - A Comprehensive Guide to Movies
Espn Transfer Portal Basketball
Leccion 4 Lesson Test
Moonlike Rock Arceus
The Meaning Behind The Song: Waymore's Blues by Waylon Jennings - Beat Crave
Wordscape 5832
Jordanbush Only Fans
Nalo Winds
The 15 Best Things to Do in Branson, Missouri
Kate Spade OUTLET • bis 70%* im Sale | Outletcity Metzingen
Sitcoms Online Message Board
Ktbs Payroll Login
Hotfixes: September 13, 2024
8042872020
Ice Crates Terraria
Breakroom Bw
Karz Insurance Quote
Cox Teacher Discount
Apria Healthcare - 26 Reviews - Sacramento, CA
5 takeaways from Baylor’s historic comeback win vs. UCF: Bears find new energy in Orlando
Aspenx2 Newburyport
Chris Bailey Weather Forecast
Pearl City Hall Pearl Ms
Influencing Factors and Differences in Born Aggregometry in Specialized Hemostaseological Centers: Results of a Multicenter Laboratory Comparison
Framingham Risk Score Calculator for Coronary Heart Disease
T&J Agnes Theaters
Journal articles: 'New York (State). First Congregational Church' – Grafiati
Walgreens Rufe Snow Hightower
Our Favorite Paper Towel Holders for Everyday Tasks
Rocking Horse Ranch Itinerary
Commuter Rail Gloucester
O'reilly's Eastman Georgia
Aita For Telling My Niece Why I Kept A Distance
Saw X Showtimes Near Stone Theatres Sun Valley 14 Cinemas
Fuzz Bugs Factory Number Bonds
Tyson Foods W2 Online
About My Father Showtimes Near Marcus Saukville Cinema
Lost Pizza Nutrition
The Complete Guide to Flagstaff, Arizona
Lesson 8 Skills Practice Solve Two-Step Inequalities Answer Key
Dawat Restaurant Novi
Math Nation Algebra 2 Practice Book Answer Key
Slug Menace Rs3
Richard Grieve Judge Judy
New Application Instructions · Government Portal
Imagetrend Elite Delaware
Upgrading Fedora Linux to a New Release
Latest Posts
Article information

Author: Prof. Nancy Dach

Last Updated:

Views: 6710

Rating: 4.7 / 5 (77 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Prof. Nancy Dach

Birthday: 1993-08-23

Address: 569 Waelchi Ports, South Blainebury, LA 11589

Phone: +9958996486049

Job: Sales Manager

Hobby: Web surfing, Scuba diving, Mountaineering, Writing, Sailing, Dance, Blacksmithing

Introduction: My name is Prof. Nancy Dach, I am a lively, joyous, courageous, lovely, tender, charming, open person who loves writing and wants to share my knowledge and understanding with you.