Dear SAC users,
I could notice unexpected differences in spectrogram output when
changing ymin and ymax ranges, and I did this synthetic test:
SAC> fg random 1 2 npts 1200 delta 0.5 ; w noise.sac
SAC> fg sine 1 0 npts 1200 delta 0.5 ; mul .5 ; w sine.sac
SAC> r sine.sac ; addf noise.sac ; w sac_noise.sac
SAC> r sac_noise.sac ; rtr ; spectrogram w 30 s 5 ymin .05 ymax 1.5
<-- case 1
SAC> r sac_noise.sac ; rtr ; spectrogram w 30 s 5 ymin .5 ymax 1.5
<-- case 2, (zoom around 1Hz)
in case 1, I see the orrect spectrogram with peak around 1
while in case 2, the peak is at about 0.8. (snapshots attached)
Am I doing something wrong or this is an anomaly of spectrogram?
Thanks
Marco
Attachments
-
Macro,
That looks like a bug to me. I was able to reproduce the behavior and found that the spectrogram code does not work properly if a window on the frequency is set. If you change the second case ymin value, you can effectively move your spectrogram peak in the plot. This is not good.
A fix for this bug will be included in an upcoming version of SAC (maybe sooner considering the severity)
Thanks so much for submitting the bug report.
Brian Savage
savage<at>uri.edu
On Aug 3, 2012, at 3:34 AM, marco.olivieri<at>bo.ingv.it wrote:
Dear SAC users,
I could notice unexpected differences in spectrogram output when changing ymin and ymax ranges, and I did this synthetic test:
SAC> fg random 1 2 npts 1200 delta 0.5 ; w noise.sac
SAC> fg sine 1 0 npts 1200 delta 0.5 ; mul .5 ; w sine.sac
SAC> r sine.sac ; addf noise.sac ; w sac_noise.sac
SAC> r sac_noise.sac ; rtr ; spectrogram w 30 s 5 ymin .05 ymax 1.5 <-- case 1
SAC> r sac_noise.sac ; rtr ; spectrogram w 30 s 5 ymin .5 ymax 1.5 <-- case 2, (zoom around 1Hz)
in case 1, I see the orrect spectrogram with peak around 1
while in case 2, the peak is at about 0.8. (snapshots attached)
Am I doing something wrong or this is an anomaly of spectrogram?
Thanks
Marco
<case_1.png><case_2.png>_______________________________________________
sac-help mailing list
sac-help<at>iris.washington.edu
http://www.iris.washington.edu/mailman/listinfo/sac-help