normalization

calculate mp3 average volume

好久不见. 提交于 2020-01-05 12:16:47
问题 I need to know the average volume of an mp3 file so that when I convert it to mp3 (at a different bitrate) I can scale the volume too, to normalize it... Therefore I need a command line tool / ruby library that gives me the average volume in dB. 回答1: You can use sox (an open source command line audio tool http://sox.sourceforge.net/sox.html) to normalize and transcode your files at the same time. EDIT Looks like it doesn't have options for bit-rate. Anyway, sox is probably overkill if LAME

Normalization of facial landmark points in image processing

梦想与她 提交于 2020-01-05 03:49:20
问题 I am working on a project related to recognising emotions(sad,happy,anger etc.) from a face. I am using facial landmark detector from dlib library which detect 68 interest points. For the same emotion, these interest points can vary depending on the orientation of the face, size of eyes, lips etc on different faces. I would like to normalise these interest points that makes them invariant to orientation of the face, size of eyes, lips etc. What are the techniques can I use to do so. I would

How to normalize a histogram in python?

爱⌒轻易说出口 提交于 2020-01-02 04:31:20
问题 I'm trying to plot normed histogram, but instead of getting 1 as maximum value on y axis, I'm getting different numbers. For array k=(1,4,3,1) import numpy as np def plotGraph(): import matplotlib.pyplot as plt k=(1,4,3,1) plt.hist(k, normed=1) from numpy import * plt.xticks( arange(10) ) # 10 ticks on x axis plt.show() plotGraph() I get this histogram, that doesn't look like normed. For a different array k=(3,3,3,3) import numpy as np def plotGraph(): import matplotlib.pyplot as plt k=(3,3,3

Did I overdesign my MySQL database (users/companies/products)?

旧城冷巷雨未停 提交于 2020-01-02 02:27:10
问题 I'm new to database design, please give me advice about this. 1 When should I use a composite index? im not sure what does index does, but i do know we should put it when it will be heavly loaded like for WHERE verified = 1 and in search like company.name = something. am i right ? 2 MySQL indexes - how many are enough? is it just enough ? 3 Database Normalization is it just right? Thanks. edit* rules. each users( company member or owners ) could be a member of a company each company have some

How can I resolve a three-way polymorphic association?

半城伤御伤魂 提交于 2020-01-01 10:58:31
问题 First let me say I am using MySQL (not transactional) and that this can't be changed. Also, I have simplified the tables here for brevity and clarity. In this example a 'Lesson' is comprised of it's internal attributes and an external attributes with it's own attributes 'Readings'. 'Readings' has it's own key dependent attributes and three distinct external attributes (the reading sources). I want to avoid the polymorphic association that arrises here but am unable to wrap my head around it.

How can I resolve a three-way polymorphic association?

三世轮回 提交于 2020-01-01 10:58:11
问题 First let me say I am using MySQL (not transactional) and that this can't be changed. Also, I have simplified the tables here for brevity and clarity. In this example a 'Lesson' is comprised of it's internal attributes and an external attributes with it's own attributes 'Readings'. 'Readings' has it's own key dependent attributes and three distinct external attributes (the reading sources). I want to avoid the polymorphic association that arrises here but am unable to wrap my head around it.

How to obtain a minimal key from functional dependencies?

白昼怎懂夜的黑 提交于 2020-01-01 10:57:11
问题 I need some help and guidelines. I have the following relation: R = {A, B, C, D, E, F} and the set of functional dependencies F = { {AB -> C}; {A -> D}; {D -> AE}; {E -> F}; } What is the primary key for R ? If i apply inference rules i get these additional Function dependencies: D -> A D -> E D -> F D -> AEF A -> E A -> F A -> DEF How do I continue? 回答1: There is a well known algorithm to do this. I don't remember it, but the excercise seems to be simple enough not to use it. I think this is

Difference between canonical cover and minimal cover

旧街凉风 提交于 2020-01-01 09:37:07
问题 Apologies if this is a ridiculous question; I've searched high and low for an answer with no avail. I know how to calculate minimal cover; ie ensure each functional dependency only has one attribute on the the RHS, remove extratraneous/redudant lhs attributes by calculating closure of each examining all FD's, seeing if any can be removed (again by calculating closure) Is 'canonical' cover just another word for the same thing? 回答1: A canonical cover is "allowed" to have more than one attribute

SSE: reciprocal if not zero

ⅰ亾dé卋堺 提交于 2020-01-01 09:28:53
问题 How can I take the reciprocal (inverse) of floats with SSE instructions, but only for non-zero values? Background bellow: I want to normalize an array of vectors so that each dimension has the same average. In C this can be coded as: float vectors[num * dim]; // input data // step 1. compute the sum on each dimension float norm[dim]; memset(norm, 0, dim * sizeof(float)); for(int i = 0; i < num; i++) for(int j = 0; j < dims; j++) norm[j] += vectors[i * dims + j]; // step 2. convert sums to

Mongoose getter / setters for normalizing data

巧了我就是萌 提交于 2020-01-01 03:33:10
问题 I have User schema which has a username field. I would like this field to be case sensitive, so that users may register names such as BobDylan . However, I need my schema to validate new entries to check there are no duplicates, incase sensitive, such as bobdylan . My research has taught me that I should create an additional field in the schema for storing a lower case / upper case version, so that I can easily check if it is unique. My question is, how would I achieve this with the Mongoose