Programming Wavelets for Audio Identification [closed] - audio

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
How exactly is a wavelet used digitally?
Wikipedia states
"a wavelet could be created to have a frequency of Middle C and a
short duration of roughly a 32nd note"
Would this be a data structure holding e.g {sampleNumber, frequency} pairs?
If a wavelet is an array of these pairs, how is it applied to the audio data?
How does this wavelet apply to the analysis when using an FFT?
What is actually being compared to identify the signal?

I feel like you've conflated a few different concepts here. The first confusing part is this:
Would this be a data structure holding e.g {sampleNumber, frequency} pairs?
It's a continuous function, so pick your favourite way of representing continuous functions in a discrete computer memory, and that might be a sensible way to represent it.
The wavelet is applied to the audio signal by convolution (this is actually the next paragraph in the Wikipedia article you referenced...), as is relatively standard in most DSP applications (particularly audio-based applications). Wavelets are really just a particular kind of filter in the broader signal-processing sense, in that they have particular properties that are desirable in some applications, but they are still fundamentally just filters!
As for the comparison being performed - it's the presence or absence of a particular frequency in the input signal corresponding to the frequency (or frequencies) that the wavelet is designed to identify.

Related

Checking English Grammar with NLTK [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm starting to use the NLTK library, and I want to check whether a sentence in English is correct or not.
Example:
"He see Bob" - not correct
"He sees Bob" - correct
I read this, but it's quite hard for me.
I need an easier example.
Grammar checking is an active area of NLP research, so there isn't a 100% answer (maybe not even an 80% answer) at this time. The simplest approach (or at least a reasonable baseline) would be an n-gram language model (normalizing LM probabilities for utterance length and setting a heuristic threshold for 'grammatical' or 'ungrammatical'.
You could use Google's n-gram corpus, or train your own on in-domain data. You might be able to do that with NLTK; you definitely could with LingPipe, the SRI Language Modeling Toolkit, or OpenGRM.
That said, an n-gram model won't perform all that well. If it meets your needs, great, but if you want to do better, you'll have to train a machine-learning classifier. A grammaticality classifier would generally use features from syntactic and/or semantic processing (e.g. POS-tags, dependency and constituency parses, etc.) You might look at some of the work from Joel Tetrault and the team he worked with at ETS, or Jennifer Foster and her team at Dublin.
Sorry there isn't an easy and straightforward answer...

Compressing a string [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
There is a frequently asked question in interviews about compressing a string.
I'm not looking for a code, I only need an efficient algorithm that solves the problem.
Given a string (e.g. aaabbccaaadd), compress it (3a2b2c3a2d).
My solution:
Travel on the string. Every time I see the same letter I count it.
I will output the letter and the counter when I see a different letter coming (and start over again).
Is there more efficient way to do this?
Thanks
That's called running length encoding, and the algorithm you name is basically the best you'll get. It takes O(1) auxiliary storage (save the last symbol seen, or equivalently inspect the upcoming element; also save a counter of how many identical symbols you've seen) and runs in O(n) time. As you need to inspect each symbol at least once to know the result, you can't get better than O(n) time anyway. What's more, it can also process streams one symbol at a time, and output one symbol at a time, so you actually only need O(1) RAM.
You can pull a number of tricks to get the constant factors better, but the algorithm remains basically the same. Such tricks include:
If you stream to a slow destination (like disk or network), buffer. Extensively.
If you expect long runs of identical symbols, you may be able to vectorize the loop counting them, or at least make that loop tighter by moving out the other cases.
If applicable, tell your compiler not to worry about aliasing between input and output pointers.
Such micro-optimizations may be moot if your data source is slow. For the level of optimization some of my points above address, even RAM can counts as slow.
Use Lempel Ziv compression if your string will be sufficiently long.. The advantage is: it will not only shorten distinct repetitions but also 'groups' of repetitions efficiently. See wikipedia: Lempel-Ziv-Welch
A vague example - so that you get the idea:
aaabqxyzaaatuoiaaabhaaabi will be compressed as:
AbqxyzAtuiBhBi
where [A = aaa] & [B = Ab = aaab]
many compression algorithms are based on Huffman Coding. That's the answer I'd give in an interview

Best program to analyze data from cycle tests [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've performed some cycle tests of steel joints. The tests conditions include the application of 3 cycles per amplitude value and three different amplitudes were used.
Now I have a huge text file with rotation and moment values but I need to determine the stiffness of each branch of the diagram with a regression analysis method. Therefore I need to separate each cycle.
Do you recommend
Mathematica,
Matlab,
Excel,
or other program best suited to make this task easier?
Many thanks as always for your advice.
It's not entirely clear what you're looking for in the question. I also don't know much about Mathematica or Excel, but I'll say as much as I can about how Matlab might be used to address this problem.
When you say 'separate each cycle', I assume you mean that your text file contains data about all 3 cycles and you want to partition it into 3 separate datasets regarding each individual cycle. I would guess that Matlab will import your data file (the file->import data menu is quite flexible, and I've used it successfully with e.g. 30MB files, but if your files are hundreds of MB that might be a problem).
Assuming there is some structure to the data file, I would expect that you can slice it to achieve your desired partition, e.g.
cycle1 = data(1:3:end, :); %If data from cycles are stored in alternate rows
cycle1 = data(1:end/3, :); %If data from cycles are stored in blocks of rows
cycle1 = data(:, 3); %If data from cycles are stored in separate columns
etc. If you comment with a description of structure of the file I may be able to help further.
Regarding regression analysis, Matlab has several tools; polyfit is quite flexible and might satisfy your requirements. I don't know anything about materials, but I may be able to give better suggestions if you explain the relationship between stiffness and the measures variables.
Mathematica is great, but in terms of the widest range of tools, I'd opt for R and perhaps it's glm package. There are many other suitable packages, perhaps even a neural network or random forest for regression might make an interesting alternative, all are freely available in R.

Best turnkey relation detection library? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
What is the best turnkey (ready to use, industrial-strength) relation detection library?
I have been playing around with NLTK and the results I get are not very satisfactory.
http://nltk.googlecode.com/svn/trunk/doc/book/ch07.html
http://nltk.googlecode.com/svn/trunk/doc/howto/relextract.html
Ideally, I would like a library that can take sentences like:
"Sarah killed a wolf that was eating a child"
and turn it into a data structure that means something like:
killed(Sarah, wolf) AND eating(wolf,child)
I know that this is the subject of a large body of research and that it is not an easy task. That said, is anyone aware of a reasonably robust ready-to-use library for detecting relations?
Update: Extractiv is no longer available.
Extractiv's On-Demand REST service:
http://rest.extractiv.com/extractiv/?url=https://stackoverflow.com/questions/4732686/best-turnkey-relation-detection-library&output_format=html_viewer will process this page, extract and display the two semantic triples you desire in the bottom left corner under "GENERIC". (It throws away some of the text from the page in the html viewer, but this text is not thrown away if you utilize json or rdf output).
This is assuming you're open to a commercial, industrial strength solution, though limited free usage is allowed. It's a web service but open source libraries can be used to access it or could be purchased from Language Computer Corporation.
These relations can be read fairly easily out of the output of dependency notations. For instance, put into the Stanford Parser online, you can see both of the two subject-verb-object triples in your example in the typed dependencies collapsed representation as:
nsubj(killed-2, Sarah-1)
dobj(killed-2, wolf-4)
nsubj(eating-7, wolf-4)
dobj(eating-7, child-9)

the meaning of lightweighted object [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Please, gurus, give me a detailed explanation of, in the Object-Oriented programming world, what is lightweight object? And in other computer science fields, what does lightweight means then? Is lightweight a design pattern? Is lightweight good, is bad?
There are many meanings for lightweight, but normally it means the object which has less amount of data or which process less amount of data. Sometimes a thread is called as a lightweight process as it does a less things than a process do. Its processing is also fast than the process. A lightweight object is one which has less amount members and which are of basic types (int, float) as member variables. A light function is the one which does very less things compared to others. Normally these are inline functions. (in C context).
There is no such patterns as lightweight pattern. But Normally the systems should be consists of lightweight objects so that the maintaining those objects could be easy.
The advantages are simple debugging, maintenance and easy understanding of code. The disadvantage could be lots of objects.
There is no lightweight pattern as such but the term is fairly used in the industry.
Lightweight X tend to be used in the case where we have a somewhat well known structure X. Lightweight X is then a version of X using fewer resources in some way or the other - or is subtly different from X in some way.
The term, as is the case for most computer science, is not well-defined and is loosely used.

Resources