Clear Filters
Clear Filters

I want to find no. Of samples in particular window size. So that i can decide my nfft size.. How i can do that with matlab

7 views (last 30 days)
W_size=10; Ovlap=50;

Answers (1)

Walter Roberson
Walter Roberson on 1 Aug 2018
Number of samples in a particular window size is either the window size directly (10 in your case), or is 2 times the window size plus 1 (2*10+1 = 21) in the case that the window size is intended to be symmetric around the "current" sample.
The overlap cannot exceed one less than number of samples in the window -- so in your case, the overlap could not be more (10-1 = 9) or (21 - 1 = 20) depending how you are defining your window.
Probably you meant to write W_size=100; Ovlap=50; If so then that would very likely involve a full window of 100 samples that "slides" by 50 samples after the calculation. The size of the fft would typically be the window size (100) in this case.
You mention nfft, though, which is for non-uniform fft, which involves samples that are not uniformly spaced. In such a case, you would need to decide whether you want to sample for a fixed time (which could involve a varying number of samples, possibly none at all), or if you want to sample for a fixed number of samples (which could involve a varying amount of time.) If you sample for a fixed time period, then your nfft size would be the frequency that you are converting to, times the time window you are sampling over. If you sample with a fixed number of samples, then your nfft size would be the frequency that you are converting to, times the time spam covered by the number of samples (watch out for off-by-one errors, though.)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Products


Release

R2014a

Community Treasure Hunt

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

Start Hunting!