[med-svn] [Git][med-team/praat][master] 4 commits: New upstream version 6.1.53
Rafael Laboissière (@rafael)
gitlab at salsa.debian.org
Sun Sep 12 09:04:35 BST 2021
Rafael Laboissière pushed to branch master at Debian Med / praat
Commits:
4189febd by Rafael Laboissière at 2021-09-11T12:33:03-03:00
New upstream version 6.1.53
- - - - -
977ada49 by Rafael Laboissière at 2021-09-11T12:45:53-03:00
Merge tag 'upstream/6.1.53'
Upstream version 6.1.53
- - - - -
5a936ddb by Rafael Laboissière at 2021-09-11T13:19:28-03:00
d/What_s_new_.html: Update upstream changelog
Gbp-Dch: Ignore
- - - - -
b1849913 by Rafael Laboissière at 2021-09-12T05:04:05-03:00
Changelog entry for version 6.1.53-1
Gbp-Dch: Ignore
- - - - -
5 changed files:
- debian/What_s_new_.html
- debian/changelog
- dwtest/test_Sound_noiseReduction.praat
- dwtools/Sound_extensions.cpp
- sys/GraphicsScreen.cpp
Changes:
=====================================
debian/What_s_new_.html
=====================================
@@ -7,6 +7,22 @@ What's new?
<p>
Latest changes in Praat.</p>
<p>
+<b>6.1.53</b> (8 September 2021)</p>
+<ul>
+<li>
+ Linux: corrected a bug that caused PDF files to be misaligned if the origin was not in the top left corner.
+</ul>
+<p>
+<b>6.1.52</b> (25 August 2021)</p>
+<ul>
+<li>
+ FormantPath window: more formant listings and stress listings.
+<li>
+ Sound window: on Cut or Paste, all windows that contain that Sound now get ungrouped.
+<li>
+ Corrected a crash when reading Vorbis files on some 32-bit platforms.
+</ul>
+<p>
<b>6.1.51</b> (22 July 2021)</p>
<ul>
<li>
@@ -482,7 +498,7 @@ What used to be new?</h3>
</ul>
<hr>
<address>
- <p>© ppgb, July 22, 2021</p>
+ <p>© ppgb, September 8, 2021</p>
</address>
</body>
</html>
=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+praat (6.1.53-1) unstable; urgency=medium
+
+ * New upstream version 6.1.53
+
+ -- Rafael Laboissière <rafael at debian.org> Sat, 11 Sep 2021 13:47:39 -0300
+
praat (6.1.52-1) unstable; urgency=medium
* New upstream version 6.1.52
=====================================
dwtest/test_Sound_noiseReduction.praat
=====================================
@@ -1,20 +1,44 @@
# test_Sound_noiseReduction.praat
-# djmw 20190326
+# djmw 20190326, 20210831
appendInfoLine: "test_Sound_noiseReduction.praat"
-sound = Create Sound from formula: "test", 1, 0, 1, 44100, "0.0"
-Formula: "randomGauss(0,0.1) + if x < 0.5 then 0.5*sin(2*pi*377*x) else 0 fi"
-spectrum = To Spectrum: "no"
-bandEnergy = Get band energy: 1000, 9000
-for i to 10
- db = -10 * (i - 1)
- selectObject: sound
- copy = Copy: string$ (db)
- soundReduced = Reduce noise: 0.5, 1, 0.025, 80, 10000, 40, db, "spectral-subtraction"
- spectrumReduced = To Spectrum: "no"
- bandEnergyReduced = Get band energy: 1000, 9000
- appendInfoLine: tab$, "db=", db, " ", 10* log10 (bandEnergyReduced/4e-10), " ", 10* log10 (bandEnergyReduced / bandEnergy), " ", bandEnergy / bandEnergyReduced
- removeObject: spectrumReduced, soundReduced, copy
-endfor
-removeObject: spectrum, sound
+
+
+@ test_reduction
+ at test_numberOfBands: 10
+
appendInfoLine: "test_Sound_noiseReduction.praat OK"
+
+procedure test_reduction
+ appendInfoLine: tab$, "test_reduction"
+ .sound = Create Sound from formula: "test", 1, 0, 1, 44100, "0.0"
+ Formula: "randomGauss(0,0.1) + if x < 0.5 then 0.5*sin(2*pi*377*x) else 0 fi"
+ .spectrum = To Spectrum: "no"
+ .bandEnergy = Get band energy: 1000, 9000
+ for .i to 10
+ .db = -10 * (.i - 1)
+ selectObject: .sound
+ .copy = Copy: string$ (.db)
+ .soundReduced = Reduce noise: 0.5, 1, 0.025, 80, 10000, 40, .db, "spectral-subtraction"
+ .spectrumReduced = To Spectrum: "no"
+ .bandEnergyReduced = Get band energy: 1000, 9000
+ appendInfoLine: tab$, tab$, "db=", .db, " ", 10* log10 (.bandEnergyReduced/4e-10), " ",
+ ... 10* log10 (.bandEnergyReduced / .bandEnergy), " ", .bandEnergy / .bandEnergyReduced
+ removeObject: .spectrumReduced, .soundReduced, .copy
+ endfor
+ removeObject: .spectrum, .sound
+ appendInfoLine: tab$, "test_reduction OK"
+endproc
+
+procedure test_numberOfBands: .numberOfTries
+ appendInfoLine: tab$, "test_numberOfBands"
+ for .i to .numberOfTries
+ .samplingFrequency = randomUniform(1000, 50000)
+ .sound = Create Sound from formula: "test", 1, 0, 1, .samplingFrequency, "0.0"
+ .windowLength = randomUniform (0.005,0.06)
+ .soundReduced = Reduce noise: 0.5, 1, .windowLength, 80, 10000, 40, -20, "spectral-subtraction"
+ appendInfoLine: tab$, tab$, "Fmax = ", .samplingFrequency, " windowLength = ", .windowLength
+ removeObject: .sound, .soundReduced
+ endfor
+ appendInfoLine: tab$, "test_numberOfBands OK"
+endproc
\ No newline at end of file
=====================================
dwtools/Sound_extensions.cpp
=====================================
@@ -2586,20 +2586,33 @@ static autoSound Sound_reduceNoiseBySpectralSubtraction_mono (Sound me, Sound no
Melder_require (noise -> ny == 1 && noise -> ny == 1,
U"The number of channels in the noise and the sound should equal 1.");
- const double samplingFrequency = 1.0 / my dx;
+ const double samplingFrequency = 1.0 / my dx, nyquistFrequency = 0.5 / my dx;
autoSound denoised = Sound_create (1, my xmin, my xmax, my nx, my dx, my x1);
autoSound const analysisWindow = Sound_createSimple (1, windowLength, samplingFrequency);
const integer windowSamples = analysisWindow -> nx;
+ const integer wantedNumberOfFrequencyBins = windowSamples / 2 + 1;
autoSound const noise_copy = Data_copy (noise);
Sound_multiplyByWindow (noise_copy.get(), kSound_windowShape::HANNING);
- const double bandwidth = samplingFrequency / windowSamples;
+ /*
+ The number of bands in the noise Ltas and the number of frequencies in the
+ sound spectra preferably should to be equal.
+ numberOfBands = Melder_iceiling (nyquistFrequency / bandwidth)
+ wantedNumberOfFrequencyBins = windowSamples / 2 + 1;
+ We can calculate the bandwidth to make numberOfBands == wantedNumberOfFrequencyBins by applying
+ the following two conditions
+ (1) nyquistFrequency / b > wantedNumberOfFrequencyBins - 1 && (2) nyquistFrequency / b < wantedNumberOfFrequencyBins
+ (1) gives b1 < nyquistFrequency / (wantedNumberOfFrequencyBins - 1)
+ (2) gives b2 > nyquistFrequency / wantedNumberOfFrequencyBins
+ Take b = (b1 + b2) / 2
+ */
+ double bandwidth = nyquistFrequency * (wantedNumberOfFrequencyBins - 0.5) / (wantedNumberOfFrequencyBins * (wantedNumberOfFrequencyBins - 1));
autoLtas const noiseLtas = Sound_to_Ltas (noise_copy.get(), bandwidth);
+ Melder_assert (noiseLtas -> nx == wantedNumberOfFrequencyBins);
autoVEC const noiseAmplitudes = raw_VEC (noiseLtas -> nx);
for (integer iband = 1; iband <= noiseLtas -> nx; iband ++) {
const double powerDensity = 4e-10 * pow (10.0, noiseLtas -> z [1] [iband] / 10.0);
noiseAmplitudes [iband] = sqrt (0.5 * powerDensity);
}
-
autoMelderProgress progress (U"Remove noise");
const double noiseAmplitudeSubtractionScaleFactor = 1.0 - pow (10.0, noiseReduction_dB / 20.0);
=====================================
sys/GraphicsScreen.cpp
=====================================
@@ -604,6 +604,9 @@ autoGraphics Graphics_create_pdffile (MelderFile file, int resolution,
isdefined (y1inches) ? 1.0 : 0.0, isdefined (y1inches) ? 12.0 : y2inches
);
cairo_scale (my d_cairoGraphicsContext, 72.0 / resolution, 72.0 / resolution);
+ cairo_translate (my d_cairoGraphicsContext,
+ ( isdefined (x1inches) ? - x1inches : 0.0 ) * resolution,
+ ( isdefined (y1inches) ? y2inches - 12.0 : 0.0 ) * resolution);
#elif quartz
CFURLRef url = CFURLCreateWithFileSystemPath (nullptr, (CFStringRef) Melder_peek32toCfstring (file -> path), kCFURLPOSIXPathStyle, false);
CGRect rect = CGRectMake (0, 0,
View it on GitLab: https://salsa.debian.org/med-team/praat/-/compare/0fbc3a019a933b3f3140f9120dfee372f480dc2b...b1849913d01102a04cb4edd9018649e905f4c929
--
View it on GitLab: https://salsa.debian.org/med-team/praat/-/compare/0fbc3a019a933b3f3140f9120dfee372f480dc2b...b1849913d01102a04cb4edd9018649e905f4c929
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210912/46217ec6/attachment-0001.htm>
More information about the debian-med-commit
mailing list