# Obsolete Signal Processing functions

I need some tools to detect the fundamental frequency and pitch of a sound. I Googled for "pitch detect" and found some .nb files that do these tasks, but all the files are in Mathematica 3.0 format. I downloaded and installed the Signal Processing package, but this did not help, because these files use some obsolete functions like DiscreteWindow, ContinuousPiecewiseData, etc. I also tested the Signals and Systems toolbox but for the same reason there was no output in most cases.

Are there any newer replacements of these functions or some way to find their definitions in some old packages?

-
Take a look at all sections of Signal Processing guide - would it suit your goals? – Vitaliy Kaurov Jan 8 at 19:18
Why couldn't you just use FourierTransform? – cartonn Jan 8 at 19:55

## 1 Answer

I downloaded and looked at some of these files you linked to above. To get one notebook autocorr.nb for example to run on V9, here are the steps I did:

Removed

  <<MiscellaneousAudio

  The functionality in  is now available through the newly created Audio Package.


Also removed

<<StatisticsDescriptiveStatistics

Functionality in this package has been added to the built-in Mathematica kernel.
is replaced by the kernel function Commonest.


Changed

 snd=ReadSoundfile["oboe1.wav"]


to

 snd=Import["ExampleData/rule30.wav","Data"][[1]]


However, ReadSoundfile did more than just read the sound data, it also did:

While Import["ExampleData/rule30.wav","Data"] does not do that. It leaves the data as is:

snd[[1, 1 ;; 10]]
(* {0., -0.0078125, -0.0078125, -0.015625, -0.015625,
-0.0078125, -0.0078125, -0.0078125, -0.0078125, 0.}  *)


If there is no other function to do this conversion, you can do the mapping yourself and do the conversion and look more into it. I did not do this for now as I just wanted to see what changes needed to make it work. If you have trouble with this conversion, you could post a separate question.

Now going on using the sound data as is.....

Replaced

 ListPlot[sft,PlotJoined->True,PlotRange->All,PlotStyle->RGBColor[0,0,1],Frame->True];


by

 ListPlot[sft,Joined->True,PlotRange->All,PlotStyle->RGBColor[0,0,1],Frame->True];


and it worked now

Ofcourse the plots do not look as the original ones, since the sound data was not scaled in this case as it was before.

## Conclusion

To get this one notebook autocorr.nb to work on V9, the above changes are what is needed. You can examine the other notebooks the same way.

The code is hard to read, and they use UpperCase for variable names, which is bad. I am sure it can be optimized much more as it is full of explicit loops and procedural style which can be slow in Mathematica.

FYI, I have the old signal processing package (it does not run any more on newer versions) and the documentaions I kept here

As was mentioned above, V9 now contains many new signal processing functions.

Update:

Just to answer the comment below:

  I also tried change pitchtrack.nb of the above mentioned package with no success.
I don't know how to replace DiscreteWindow, ContinuousPiecewiseData, and other
functions. Maybe these are built-in functions of the old Mathematica 2. Any help?


These are in the old signal processing package, which I added a link to above.

Basically those notebooks used the old Mathematica DSP package. Therefore, to use them now, they need to be converted to use the new DSP functions in V9 or other functions in current version of Mathematica.

-
 I also tried change pitchtrack.nb of the above mentioned package with no success. I don't know how to replace DiscreteWindow, ContinuousPiecewiseData, and other functions. Maybe these are built-in functions of the old Mathematica 2. Any help? Also there is a strange table called Fraza in many notebooks (for example in amdf.nb) without any definition! Some ideas please! – user5326 Jan 9 at 6:11 @user5326, I added note above. – Nasser Jan 9 at 7:02