Sun 11 Jan 2015 04:55:50 PM UTC, comment #13:
Applied your docstring patch in https://sourceforge.net/p/octave/signal/ci/e5577e2b208f87f6f28fc52f8e21ba8248d0e6f8/
|
Tue 04 Nov 2014 02:22:43 PM UTC, comment #12:
I know, that's why I assigned this bug to myself :)
The main problem is that the demo as written now requires an audio file, which I'd rather avoid adding to the package just for a demo. So the demo will stay disabled. The rest of your changes are of course fine, I'll take care of merging it.
|
Tue 04 Nov 2014 01:58:44 PM UTC, comment #11:
Hi Mike Miller.
Carandraug says the you are the closest one to a maintainer of the signal pkg. If you would review my two suggestions and push them then this bug report can be closed.
thanks
|
Mon 03 Nov 2014 01:31:45 AM UTC, comment #10:
Here is a patch to make the second demo work.
This should be applied after the first patch.
(file #32359)
|
Sun 02 Nov 2014 07:15:35 PM UTC, comment #9:
This problem might be a result of the fix to
bug #30509, 'imshow' doesn't reverse 'ydir'
|
Sun 02 Nov 2014 07:11:31 PM UTC, comment #8:
here is a patch.
(file #32357)
|
Sun 02 Nov 2014 06:40:47 PM UTC, comment #7:
If the last two lines of the example are set to:
imagesc(t, f, log(S)); # display in log scale
set (gca, 'ydir','normal')
then the plot looks good to me.
|
Sun 02 Nov 2014 04:28:54 PM UTC, comment #6:
I mean just for this plot. Don't change image or imagesc.
Or use some other way to plot it
|
Sun 02 Nov 2014 04:26:07 PM UTC, comment #5:
So to fix it we should change the ydir property.
|
Sun 02 Nov 2014 04:17:35 PM UTC, comment #4:
That is correct, try calling `image()` or `demo image` for example. The y-axis for images always runs top to bottom. See the `ydir` axis property.
|
Sun 02 Nov 2014 04:10:10 PM UTC, comment #3:
Yes that is the issue that I see. But I don't understand image and imagesc --- is the 0,0 location in the top left corner for images and in the bottom left corner for plots? the array that spegram produces expects the 0,0 to be in the bottom left corner. and when we look at a spectogram we expect 0,0 to be in the bottom left corner.
|
Sun 02 Nov 2014 03:44:44 PM UTC, comment #2:
Thanks for your bug report. Can you suggest an appropriate fix for the y-axis label? Is that the only issue you see with the example in the docstring?
|
Sun 02 Nov 2014 03:12:00 AM UTC, comment #1:
flipud flips the image but not the Y axis.
|
Sun 02 Nov 2014 02:35:11 AM UTC, original submission:
the example given in specgram has a wrong Y axis
+verbatum+
## Speech spectrogram
[x, Fs] = auload(file_in_loadpath("sample.wav")); # audio file
step = fix(5*Fs/1000); # one spectral slice every 5 ms
window = fix(40*Fs/1000); # 40 ms data window
fftn = 2^nextpow2(window); # next highest power of 2
[S, f, t] = specgram(x, fftn, Fs, window, window-step);
S = abs(S(2:fftn*4000/Fs,:)); # magnitude in range 0<f<=4000 Hz.
S = S/max(S(:)); # normalize magnitude so that max is 0 dB.
S = max(S, 10^(-40/10)); # clip below -40 dB.
S = min(S, 10^(-3/10)); # clip above -3 dB.
imagesc(t, f, flipud(log(S))); # display in log scale
-verbatum-
Zero frequency is at the top left but should be at the bottom left.
Specgram works OK but the problem is with preparations and plotting with imagesc
|