Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita878ba1

Browse files
committed
add fixes
1 parentdc87e80 commita878ba1

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

‎samples/cpp/spectrogram.cpp‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,11 @@ class AudioDrawing
384384
// as it changes over time.
385385
// In practice, the procedure for computing STFTs is to divide a longer time signal
386386
// into shorter segments of equal length and then compute the Fourier transform separately
387-
// on each shorter segment. This reveals the Fourier spectrum on each shorter segment.
387+
// on each shorter segment. This reveals the Fourier spectrum on each shorter segment.
388388
// One then usually plots the changing spectra as a function of time, known as a spectrogram
389389
// or waterfall plot.
390390
// https://en.wikipedia.org/wiki/Short-time_Fourier_transform
391-
391+
392392
int timeStep = windLen - overlap;
393393
Mat dstMat;
394394
vector<double> stftRow;
@@ -1059,8 +1059,6 @@ int main(int argc, char** argv)
10591059
"{waitTime w | 10 | parameter to cv.waitKey() for dynamic update of file input, takes values in milliseconds }"
10601060
;
10611061

1062-
1063-
10641062
CommandLineParserparser(argc, argv, keys);
10651063
if (parser.has("help"))
10661064
{

‎samples/python/spectrogram.py‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def STFT(self, inputAudio):
321321
The Short-time Fourier transform (STFT), is a Fourier-related transform used to determine
322322
the sinusoidal frequency and phase content of local sections of a signal as it changes over
323323
time.
324-
In practice, the procedure for computing STFTs is to divide a longer time signal into
324+
In practice, the procedure for computing STFTs is to divide a longer time signal into
325325
shorter segments of equal length and then compute the Fourier transform separately on each
326326
shorter segment. This reveals the Fourier spectrum on each shorter segment. One then usually
327327
plots the changing spectra as a function of time, known as a spectrogram or waterfall plot.
@@ -375,8 +375,8 @@ def STFT(self, inputAudio):
375375
defdrawSpectrogram(self,stft):
376376

377377
frameVectorRows=stft.shape[0]
378-
frameVectorCols=stft.shape[1]
379-
378+
frameVectorCols=stft.shape[1]
379+
380380
# Normalization of image values from 0 to 255 to get more contrast image
381381
# and this normalization will be taken into account in the scale drawing
382382
colormapImageRows=255
@@ -802,5 +802,3 @@ def initAndCheckArgs(self, args):
802802
args=parser.parse_args()
803803

804804
AudioDrawing(args).Draw()
805-
806-

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp