CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Spectrogram

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 1 Post By LuckyTran
  • 1 Post By FMDenaro
  • 1 Post By FMDenaro
  • 1 Post By FMDenaro
  • 1 Post By LuckyTran
  • 1 Post By FMDenaro
  • 1 Post By LuckyTran

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2021, 12:40
Question Spectrogram
  #1
Senior Member
 
Zese
Join Date: Sep 2013
Posts: 102
Rep Power: 12
zese is on a distinguished road
Hi,

Is there anyone who have done the Spectrogram on numerical unsteady pressure or velocity signal?

How I can make a better resolution for low frequencies and skip high frequencies.

Best regards,
zese is offline   Reply With Quote

Old   November 15, 2021, 13:16
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,675
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Bin your signal. You'll lose the lowest frequencies at the expense of resolution. And you increase sample size for highest resolutions and get better statistics.
zese likes this.
LuckyTran is offline   Reply With Quote

Old   November 15, 2021, 14:13
Default
  #3
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,769
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by zese View Post
Hi,

Is there anyone who have done the Spectrogram on numerical unsteady pressure or velocity signal?

How I can make a better resolution for low frequencies and skip high frequencies.

Best regards,

Do you want to build a map in the (k,t) plane of the spectal content, right?



But I don't fully understand your question, you can filter out high frequencies but the low frequencies should be already well resolved.
Could you detail what you are doing in the simulation of your flow problem?
zese likes this.
FMDenaro is offline   Reply With Quote

Old   November 17, 2021, 01:56
Question
  #4
Senior Member
 
Zese
Join Date: Sep 2013
Posts: 102
Rep Power: 12
zese is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Do you want to build a map in the (k,t) plane of the spectal content, right?



But I don't fully understand your question, you can filter out high frequencies but the low frequencies should be already well resolved.
Could you detail what you are doing in the simulation of your flow problem?
[QUOTE=FMDenaro;816601]Do you want to build a map in the (k,t) plane of the spectal content, right?

Dear

I have the time varying pressure data as the attach. the time step for numerical simulation was 0.00054 so I set the sample time as this value. the number of total samples are about 14000 and there are two frequencies which are important for me, 18 and 2.5 Hz. when I plot spectrogram the range of frequency is 0-950 when I decrease it the plot has no resolution and it is not clear. the pictures are attached.
Fs = 1/DT;
[S,F,T,P] = spectrogram(X,500,300,500,Fs);
surf(T,F,10*log10(abs(P)),'EdgeColor','none');
axis xy; axis tight; colormap(jet); view(0,90);
xlabel('Time (s)');
ylabel('Frequency (Hz)');

how I can filter out other frequencies except 2.5 and 18?

I showed the pictures of spectrogram in attached files for both initial and the other zoom below 50 Hz
Attached Images
File Type: jpg 1.jpg (47.7 KB, 10 views)
File Type: jpg 2.jpg (65.4 KB, 8 views)
File Type: jpg 3.jpg (53.7 KB, 6 views)
zese is offline   Reply With Quote

Old   November 17, 2021, 03:59
Default
  #5
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,769
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
[QUOTE=zese;816713]
Quote:
Originally Posted by FMDenaro View Post
Do you want to build a map in the (k,t) plane of the spectal content, right?

Dear

I have the time varying pressure data as the attach. the time step for numerical simulation was 0.00054 so I set the sample time as this value. the number of total samples are about 14000 and there are two frequencies which are important for me, 18 and 2.5 Hz. when I plot spectrogram the range of frequency is 0-950 when I decrease it the plot has no resolution and it is not clear. the pictures are attached.
Fs = 1/DT;
[S,F,T,P] = spectrogram(X,500,300,500,Fs);
surf(T,F,10*log10(abs(P)),'EdgeColor','none');
axis xy; axis tight; colormap(jet); view(0,90);
xlabel('Time (s)');
ylabel('Frequency (Hz)');

how I can filter out other frequencies except 2.5 and 18?

I showed the pictures of spectrogram in attached files for both initial and the other zoom below 50 Hz



Your case becomes statistically steady after about t=4.5. You should pick your values after that time, you see the signal is periodic. That is you could sample some interval of periodicity and perform the FFT, then take the averaging.
zese likes this.
FMDenaro is offline   Reply With Quote

Old   November 17, 2021, 04:11
Default
  #6
Senior Member
 
Zese
Join Date: Sep 2013
Posts: 102
Rep Power: 12
zese is on a distinguished road
[QUOTE=FMDenaro;816718]
Quote:
Originally Posted by zese View Post




Your case becomes statistically steady after about t=4.5. You should pick your values after that time, you see the signal is periodic. That is you could sample some interval of periodicity and perform the FFT, then take the averaging.
I know I did already FFT but I wanted to see when in time these frequencies are created. so I did some transient simulation by changing flow rate from BEP to PL of turbine.
zese is offline   Reply With Quote

Old   November 17, 2021, 05:11
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,769
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
[QUOTE=zese;816720]
Quote:
Originally Posted by FMDenaro View Post

I know I did already FFT but I wanted to see when in time these frequencies are created. so I did some transient simulation by changing flow rate from BEP to PL of turbine.

Try to pickup your signal in the range of time from 1.5 to 4, then subtract the linear slope in such a way to consider only the fluctuations.
zese likes this.
FMDenaro is offline   Reply With Quote

Old   November 17, 2021, 14:07
Default
  #8
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,675
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
You really don't need to worry about statistics when using the spectrogram. Subtracting out this linear background component is like setting the FFT coefficients to zero from 0 thru 0.22 Hz.

I don't have experience with your signal to tell you why you do not get more distinct bands like you expect except to tell you to play with it more.

I personally don't use the spectrogram function in matlab for making spectrograms plots, I like better the Constant Q transform method (for cultural reasons). However, theoretically they are the same except the bin-widths are varying in the constant Q transform whereas the frequency bins are constant width when you use an FFT.

But if there was a strong response at 2.5 and 18 Hz in your system, you would be able to see their envelopes in the temporal signal. And I'm not sure I see any envelope for any frequency. I would recommend running some test cases using the same background linear signal, with numerically/artificially added sinusoidal functions with periodic frequencies of 2.6 and 18 Hz so you can see what the spectrogram ought to look like. And then convince yourself that your signal does not look anything like this.
zese likes this.
LuckyTran is offline   Reply With Quote

Old   November 17, 2021, 14:47
Default
  #9
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,769
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I have no direct experience in the spectogram function in matlab. But if the goal is to get the onset of the frequency pattern appearing after t=4.5 I would first perform the simple FFT of the previous linear windows. Clearly, using only the fluctuating part of the signal. This is the first check I would do.

Then we can check for the proper method to find the times of the onset of such frequencies.
zese likes this.
FMDenaro is offline   Reply With Quote

Old   November 17, 2021, 15:26
Default
  #10
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,675
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
I'm sorry, I didn't realize we were looking at the frequency response after ~4 seconds (I was only looking at the ramp). Actually you can clearly see two envelopes. The lower frequency one is around 2 Hz.

But having a signal length of only 2 or so seconds is not very many samples and it will be hard to get any meaningful resolution of this in a spectrogram. Can we not sample longer....? Maybe it's just spectral leakage from not having a long enough signal.
zese likes this.
LuckyTran is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:03.