How to decrease frequency resolution by keeping RMS same in MATLAB
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
Hello, I am having the FFT of a signal with 0.1 Hz resolution with total frequency range of 0Hz to 500Hz (Sampling rate is 1000Hz, time signal length is 10sec), but i want FFT with 0.390016Hz resolution, how can i perform this change in MATLAB, as i am new to MATLAB, any help in this regard would be much appreciated, thanks in advance
Accepted Answer
dpb
on 25 Jun 2021
Frequency resolution is solely dependent upon the sample rate and number of FFT points used -- you since the number of points is an integer you may/may not be able to hit the exact frequency spacing to the full precision, but can get close...
Fs=1000;
dfWanted=0.390016;
NFFT=Fs/2/dfWanted;
>> NFFT
NFFT =
1.281998687233344e+03
>>
Hence, your closest N for the desired frequency resolution would be
>> round(NFFT)
ans =
1282
>>
and the actual df you'll get will be
>> Fs/2/1282
ans =
0.390015600624025
>>
9 Comments
Gaurav Kumar
on 25 Jun 2021
Edited: Gaurav Kumar
on 25 Jun 2021
Thanks dpb for the reply, however i was looking for some way out to decrease the resolution to 0.390016Hz from 0.1 Hz with the same signal and sampling rate, since i have the data at 0.1Hz resolution, is it not possible to get the same data at 0.390016Hz resolution?, i understand that it would change the amplitude of the spectrum to adjust the overall RMS of the signal, i mean, that is how it is done in LMS Test Lab, the same function i want to perform through MATLAB to do a correlation study with Test data which is at 0.390016Hz resolution, thanks
Gaurav Kumar
on 25 Jun 2021
Because of the mismatch in frequency resolution (of the FFT done through MATLAB and FFT done through LMS Testlab) the amplitudes are actually not matching with the test data, also as expected getting more peaks than required.
dpb
on 25 Jun 2021
You can't change mother nature -- the sampling frequency and input signal are the same above; you just change the size of the NFFT to change the frequency resolution of the output by either increasing or decreasing NFFT from where it was before.
You could, of course, do a binning/aglomeration process with the given FFT you have already, but why not take the simpler way out and just recompute at the desired resolution?
I have no idea what LMS Test Lab is/does, but if it does whatever it does correctly, it should produce the same result as does fixing the NFFT to match (although if it is doing some ex post facto reaveraging/rebinning, it could then match the binning df to match.
I dunno, I never tried it on FFT; it's cheap 'n easy to just redo the FFT itself but I guess you could try the Signal Processing resample function on the real and imaginary parts and see what happens. Or, perhaps the DSP Toolbox which I don't have might have some other post-processing tools, I don't know.
Gaurav Kumar
on 25 Jun 2021
Thanks again dpb for the insight, i do agree that redoing the whole FFT is cheaper, however that, in my case, would mean doing the whole analysis to generate the time signal with desired no. Of sample points to get the desired freq. resolution, instead i would request, if you can give me a reference to some article on binning algorithms as mentioned or if possible, can you explain the method by which i can go for the binning of the FFT i have?
"... would mean doing the whole analysis to generate the time signal with desired no. Of sample points..."
Why? You mean you don't have the base signal but only the FFT of the signal?
I don't have any references to such binning algorithms specifically, it's essentially just an interpolation/decimation.
I've never tried this; my past experience has all been in the field with a signal analyzer from any of the myriad of vendors and just reset the collection parameters and Boom! there's the new result...or have saved gazillions of time histories that can post-process at will similarly with MATLAB or other toolsets. I simply haven't been in the situation where I only had one and only one FFT that I had to try to make something else of.
If I had that FFT in both amplitude and phase portions, I'd probably then just IFFT it back to the time domain and then resample/recompute that way instead.
Gaurav Kumar
on 25 Jun 2021
Thanks a lot dpb, i got the point
Gaurav Kumar
on 29 Jun 2021
Hey dpb, I found this article on the query which I had posted, I thought of sharing it with you, please have a look, you might find it interesting
Thanks
dpb
on 29 Jun 2021
Interesting, indeed. Be curious how that would/does compare to the idea of converting back to time domain and recomputing. I note they don't give any real examples of measured signals
Gaurav Kumar
on 30 Jun 2021
Just to have a general understanding, whether I was doing it correctly or not, I will put forth my process:
To change the resolution to 0.390Hz, i had reduced the length of the time signal to contain 2563 data points, meaning i have reduced the original 10.000 sec duration time signal to 2.563 sec duration signal (time step is 0.001 second), with that the FFT which I received was of 0.39Hz resolution, however the FFT didn't match the FFT data from the other software (which might be using the interpolation/decimation function shared above).
However, interesting point is that, when i calculate the FFT at 0.1Hz which is the lowest possible resolution for my time signal, the FFT from MATLAB matches with that of the other software exactly
So, the only thing I could confirm here is that the FFT that has been generated for 0.390016Hz resolution from the other software (with which I wanted to match my MATLAB results) is not changing the time signal length or the sampling rate, it is just using some sort of interpolation/decimation function and guess that's correct as the professionals from all over the world are using its data (Siemens TestLab).
Please correct the process which I am following for obtaining 0.39Hz FFT data from MATLAB, if i am doing something wrong, thanks a lot again for your valuable inputs and suggestions.
More Answers (0)
Categories
Find more on Signal Processing Toolbox in Help Center and File Exchange
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!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
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
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
- United Kingdom (English)