Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added spectrogram #23

Merged
merged 4 commits into from
Apr 11, 2014
Merged

added spectrogram #23

merged 4 commits into from
Apr 11, 2014

Conversation

bjarthur
Copy link
Contributor

please consider adding this convenience function. i couldn't find it anywhere in julia or it's packages. let me know if i missed it!

@jfsantos
Copy link
Member

Hi Ben,

this is definitely something we need and I also did not find anything similar in any published package. We should have some tests for this function before adding it to the package. I'll try to come up with something, but feel free to propose some tests too.

p=hcat(p...)
t=[1:size(p,2)]*(nfft-noverlap)/fs
f=[1:size(p,1)]/size(p,1)*(fs/2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not return ranges (replace the brackets with parens) instead of arrays?

@simonster
Copy link
Member

This is another case where there is substantial performance to be gained by using the FFTW plan interface, but that interface is currently in flux (see JuliaLang/julia#6193), so I'm fine with merging this for now.

I personally appreciate the utility of accepting the sample rate and returning frequencies here, but if we do it, we should probably also do it for the other functions in this module.

@bjarthur
Copy link
Contributor Author

returning ranges and making tests are both great ideas. for the latter, how about testing its output with matlab? should probably add docs too.

@jfsantos
Copy link
Member

Comparing with output from another tool (MATLAB/Python) is a good idea, but in this case you should export the output to a text file instead of generating it on-the-fly (that way, we don't have additional requirements for testing the package).

Regarding documentation, feel free to add it to the file corresponding to the periodogram module in the doc/ directory. The website is automatically updated after each commit to master.

@bjarthur
Copy link
Contributor Author

docs, tests, ranges, and bug fixes all now committed. i also changed the input arg names to be consistent with the rest of the module.

i was unable to figure out how to run the tests automatically, but it all works when done by hand.

@bjarthur
Copy link
Contributor Author

this new commit is what i have in mind for inputing a window function to spectrogram.

also note that filter_design's tests are failing. i don't think this is my fault. i did however fix some deprecations with this commit.

@jfsantos
Copy link
Member

I noticed our filter_design tests are failing, too. There are some wrong coefficients in the computed filters. @simonster, could you take a look as soon as you have some time? Thanks!

I am a bit busy currently and there's no hope of it getting better for the next couple of weeks, so I still could not test everything and merge your updates, sorry!

@simonster
Copy link
Member

It seemed like the differences in the filter coefficients were still quite small (< eps, apparently) so I just changed the error bound. I should probably track down exactly when/why this started failing, though. There was also an odd bug in the Hilbert tests apparently due to FloatRange.

@bjarthur
Copy link
Contributor Author

should've tested with non-unitary sampling rates in the first couple of commits!

@simonster simonster merged commit 6bba3de into JuliaDSP:master Apr 11, 2014
@simonster
Copy link
Member

Sorry, I completely forgot about this PR. Merged, and thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants