Is there a way to extract only the content related to the main and important frequencies when we get the FFT and have the information related to the important frequencies only (amplitude and frequency especially)? with help of @dan boschen so it became clear that such a work is acceptable with a good approximation that if we use the high amplitudes,it can be said that we have extracted the original signal with a good estimate.

Now, if I want to show the amplitude and frequency of the main signals with parameters, what should I do?

That is, instead of checking the entire block, we should only check two parameters that are a measure of the frequency and ampitude of the entire block.(memory constrain problem)

What comes to my mind is step by step:

1- Taking fft with specific length

2- Finding the main components of the signal: 1- their amplitude 2- their frequency

3- Showing the amplitude and frequency of the entire block, each with one parameter For the amplitude after taking FFT, well :

  • 1- get the maximum amplitude

  • 2- The whole block should be divided by the maximum amplitude.

  • 3- I should note the amplitude greater than 0.5 and their frequency.

  • 4- Consider a factor for amplitude, for example, mean

- 5- I can't think of anything for the frequency any suggestion

1- Is this procedure logical?

2- Do you have a better suggestion?

3- Regarding the frequency, do you know a parameter that can express the frequencies in the signal

What is my goal? I want to be able to find out if there are any changes in the signal ( its frequency and amplitude are changed ) by comparing these two parameters. and not by checking the entire signal block.

here is pseudocode that what im gonna do :

max_fft=max;                // find maximum 
fft_magnitude / max_fft;   //scale all magnitudes

//finding bins that have amplitude >0.5
for( i=0 ; i<N ; i++ ){
    if( fft_magnitude[i] > 0.5 ){
        bin_buff[j]=i;       // save index of bin that have amplitude>0.5
        j++ ;

//calculate mean of bins that have amplitude>0.5
while( bin_buff[j]!=0 ){
    sum+=fft_magnitude[ bin_buff[j] ]; //summation of bins that have amplitude>0.5 
    counter++;           //to use  for mean calculate
mean= sum / counter ; 

amplitude_content=mean  ;

frequency_content=?  ; //  now we have  index of bins -->so we have frequency
                       //but i dont know how & what parameter should be used that  indicates frequency content  like mean ,std_dev ....

//calculate frequency_content & amplitude_content  for  all  signal
//so we will have  data like:
//data[2] that contain data[0]=amplitude_content  & data[1]=frequency_content 

//and next use correlation to calculate how similar new data is to previous data ;

this is my approach but the frequency content is problem yet, How do I give a value to the frequency content? Do you know a suitable parameter?

and this is an example : we have strong amplitudes in the range of 22,30,45,67 Hz and if we want to see what frequency changes we had, I just want to check the dominant frequencies Now here we have 4 more dominant frequencies, but I mean more generally, that is, in places where even more frequencies have high amplitude, is there a way to have a feature that represents the dominant frequencies?

  • $\begingroup$ What exactly would be the "main and important" frequencies to you? The biggest ones? The Fourier Transform is a continuous function, do you mean the Discrete Fourier Transform (as computed with the FFT)? $\endgroup$ Commented Mar 5, 2023 at 22:15
  • $\begingroup$ @DanBoschen I mean the frequencies that play a more effective role in making the main signal. I don't know how true it is, but I think they are the ones with more amplitude. So the information about these signals can be amplitude and phase frequency, but for me it is frequency and amplitude. Or a parameter that the frequency and amplitude of the signal can be represented by one or two values. $\endgroup$
    – Ho3ein H K
    Commented Mar 5, 2023 at 23:12
  • $\begingroup$ @DanBoschenIt became clear as day , thanks, also I add more details in the question $\endgroup$
    – Ho3ein H K
    Commented Mar 6, 2023 at 11:04
  • $\begingroup$ What you are trying to do and why is also clearer. I think it is a good idea in that you can use correlation (sum of products) of the strongest FFT bins only to determine similarity. I added a new first paragraph $\endgroup$ Commented Mar 6, 2023 at 12:54
  • $\begingroup$ @DanBoschen I also added a pseudocode It is important for me to be able to check the frequency changes, but I don't know how to check the frequency changes $\endgroup$
    – Ho3ein H K
    Commented Mar 6, 2023 at 17:28

1 Answer 1


The procedure to use a subset of bins from the FFT to avoid memory issues in “checking the entire block” still requires the complete block to process. The memory saved will be that a subset of the FFT bins can be stored. The resulting “strongest” FFT bins can be compared using correlation to the strongest FFT bins from a subsequent capture to determine similarity without having to recompute the time domain waveform from the bins using the IFFT, and for that the procedure has merit in memory storage reduction.

The DFT (as given by the FFT) is the amplitude and starting phase for each complex frequency component of the time domain signal, as given by the time domain reconstruction from the frequency components (which is the inverse DFT):

$$x[n] = \frac{1}{N}\sum_{n=0}^{N-1}X(k)e^{jk\omega_o n}$$

Each frequency component as given by frequency index $k$ is an integer multiple of the fundamental frequency given by $\omega_o = 2\pi f_s/N$ where $f_s$ is the sampling rate and $N$ is the number of samples in the time domain waveform (and similarly the number of discrete frequencies in the DFT). The "main and important" features are all given in the complex value $X[k]$ for each frequency at $k\omega_o$. $X[k]$ is a complex constant having a magnitude and phase, and this would be the magnitude for frequency $k\omega_o$ and starting phase for the time domain reconstruction. Thus if $X[k]$ has a magnitude and phase as $|X[k]|e^{j\phi_k}$, then the time domain reconstruction due to each frequency component would be given as:

$$X[k]e^{jk\omega_o n} = |X[k]|e^{j\phi_k}e^{jk\omega_o n} = |X[k]|e^{j(k\omega_o n+\phi_k)}$$

When the frequency components are isolated to a few stronger bins, we could use just those strongest frequency components, in the form given above, and add the results for each bin used to get the resulting time domain reconstruction. If we used all the $X[k]$ values and not just the dominant ones, the result would add to be exactly on the expected time domain sample at given time index $n$. If we leave any of the frequency components out, then the addition will fall short, but if those values were small, we would still come close to the original value.

To demonstrate this, I created a random bandlimited time domain real waveform which is plotted below along with its DFT (the magnitude is shown below, but to note that each frequency has a magnitude and phase).

Time Freq cdb2023030502

From the DFT, I selected the strongest magnitude samples as all samples in the upper 10 dB of the magnitudes (which I chose arbitrarily as "main and important" to me), which are the frequency samples colored in red below:

Bin selection

If we use just these samples, and specifically the magnitude and phase for each of these, we end up with the following result (which was done by zero'ing all other bins and then computing the inverse FFT), compared to our original waveform:


So to note, if we had lowered the threshold to include for example the upper 20 dB, the match would be significantly closer. Similarly if we only chose a few of the strongest bins, the match would be significantly worst.

In the interest of memory reduction, it may make more sense (depending on the characteristics of the waveform) to use a much smaller FFT. The equivalent noise bandwidth of each FFT bin (when no additional windowing is used) is simply $f_s/N$ where $f_s$ is the sampling rate and $N$ is the total number of samples. Each bin in the DFT result is the average amplitude for that given frequency scaled by $N$ over that total time duration of the capture; specifically each bin at index $k$ represent the magnitude and starting phase for a rotating phasor in time expressed as $x_k[n] = \frac{1}{N}c_ke^{j k \omega_o n}$. The values therefore that could be stored are simply $c_k$, which is magnitude and phase, or $|c_k|$ if only the average magnitude is desired, as well as $k$ as the frequency index, for any frequencies above a threshold. By reducing $N$ we will reduce the number of frequencies above the threshold, and for each the value represents the standard deviation of the time domain waveform within that wider bandwidth that the frequency bin will represent in the frequency domain. (The FFT is essentially a filter bank.) Further, block by block FFT magnitude results could be averaged which would be identical to adjusting the "video bandwidth" on a spectrum analyzer (post detection averaging), serving to improve the estimate of the power within the resolution of 1 bin, but not reducing the resolution bandwidth itself.

For example, the same waveform above with a much shorter $N=16$ results in the following FFT magnitude plot:

FFT over 16 samples

Here only the two largest sinusoids are selected representing the dominant energy in that respective frequency range. This wouldn't be expected to show any significant match when reconstructed in time, but in the frequency domain represents a minimum signature of the frequency content for the given waveform. Given a real waveform, the positive and negative frequencies (the upper half of the spectrum is the "negative frequencies) are redundant, so the only values that need to be stored in this case are those for bin 1 here as 8.9 dB and bin 2 here as 7.1 dB.

  • $\begingroup$ @Ho3ein Based on your comment I added further details on a suggested approach to further reduce the number of samples to store while maintaining the best estimate of average energy over a wider range of frequencies in the waveform. I hope this helps you! As for how well it can detect a change will be based on the actual change in frequency from one comparison to the next. That actual change can also be a good guide as to the optimum FFT duration to use (which then sets the resolution bandwidth for that capture). $\endgroup$ Commented Mar 8, 2023 at 12:34
  • 1
    $\begingroup$ I think it is a good approach, it has a processing cost, but it is really helpful for memory consumption, and thank you for your time. BEST REGARDS $\endgroup$
    – Ho3ein H K
    Commented Mar 8, 2023 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.