Библиотека обработки сигналов в Java? [закрытый]

Мне удалось это исправить, сначала запросив мои данные, прежде чем выбрать подзапрос. Я также добавил ROUND() к запросу, чтобы остановить null совпадения и округлить значение до ближайшего 10.

$stars = DB::table('product_reviews')->selectRaw('ROUND(AVG(stars))')
        ->whereColumn('product_id', 'product_list.id');

$product = DB::table('product_list')->join('product_categories', 'product_list.product_category', '=', 'product_categories.id')
        ->select('*')
        ->selectSub($stars, 'stars_avg')
        ->join('product_types', 'product_list.product_type', '=', 'product_types.id')
        ->where('product_list.id', (int) $productId)
        ->take(1)
        ->get()
        ->first();

Это теперь дает мне желаемый результат:

{#634 ▼
  +"id": 3
  +"cost": "150.00"
  +"product_category": 1
  +"product_type": 3
  +"product_score": 0
  +"created_at": "2019-01-16 16:34:29"
  +"updated_at": "2019-01-16 16:34:29"
  +"rating": 0
  +"down_payment": "10.00"
  +"title": "Static"
  +"price_start": "50.00"
  +"price_stop": "150.00"
  +"theme": "Custom"
  +"pages": 4
  +"rbac": 0
  +"portal": 0
  +"external_software": 0
  +"company_supplier": "Iezon Solutions"
  +"stars_avg": "5"
}
35
задан user 19 August 2013 в 00:24
поделиться

4 ответа

Я нашел книжную Обработку цифровых сигналов Java и исходный код в качестве примера. Вы могли бы просмотреть код, чтобы видеть, соответствует ли он Вашим потребностям.

можно также проверить Лаборатория дес. ложки .

Как duffymo и basszero, упомянутый в комментариях, были изменения в Java начиная с публикации DSP Java, который может повлиять на некоторые примеры кода. В частности, (относительно) новое Параллелизм пакет Utilties могло бы оказаться полезным.

9
ответ дан Bill the Lizard 27 November 2019 в 07:18
поделиться

Это выглядит довольно редким. Попробуйте Signalgo или jein или Библиотека Обработки сигналов Intel , хотя я думаю, что последний является просто оберткой JNI.

я видел много тех апплетов, о которых Вы говорили. Я думаю, что можно быть в состоянии получить БАНКИ для них и использовать API класса внутри. Вероятно, придется использовать затмение и вруб, чтобы декомпилироваться и выяснить то, что они делают, тем не менее, из-за отсутствия документации. Попробуйте источник на эта страница , например.

3
ответ дан John Ellinwood 27 November 2019 в 07:18
поделиться

Я нашел другой ресурс, хотя это не библиотека: http://www.dickbaldwin.com/tocdsp.htm . Это - просто основное обсуждение обработки сигналов и преобразования Фурье с некоторыми примерами Java. См., например, учебные руководства 1478, 1482, 1486. Не уверенный, какова лицензия на коде.

2
ответ дан dfrankow 27 November 2019 в 07:18
поделиться

My first suggestion is to not do your DSP implementation in Java. My second suggestion would be to roll your own simple DSP implementations yourself in Java.


Why not to use Java:

I have lots of experience writing DSP code over the last 10+ years... and almost none of the DSP code is in Java... so forgive me when I am hesitant to read about someone who wants to implement DSP in Java.

If you are going to be doing non-trivial DSP then you shouldn't be using Java. The reason that DSP is so painful to implement in Java is because all the good DSP implementations use low level memory management tricks, pointers (crazy amounts of pointers), large raw data arrays, etc.

Why to use Java:

If you are doing simple DSP stuff roll your own Java implementation. Simple DSP things like PSD and filtering are both relatively easy to implement (easy implementation but they won't be fast) because there is soo many implementation examples and well documented theory online.

In my case I implemented a PSD function in Java once because I was graphing the PSD in a Java GUI so it was easiest to just take the performance hit in Java and have the PSD computed in the java GUI and then plot it.


How to implement a PSD:

The PSD is usually just the magnitude of the FFT displayed in dB. There are many examples from academic, commercial and open-source showing how to compute the magnitude of the FFT in dB. For example Apache has a Java implementation that gives you the FFT output and then you just need to convert to magnitude and dB. Anything after the FFT should be tailored to what you need/want.


How to implement lowpass, bandpass filtering:

The easiest implementation (not the most computationally efficient) would in my opinion be using an FIR filter and doing time domain convolution.

Convolution is very easy to implement it is two nested for loops and there are literally millions of example code on the net.

The FIR filter will be the tricky part if you don't know anything about filter design. The easiest method would be to use Matlab to generate your FIR filter and then copy the coefficents into java. I suggest using firpmord() and firpm() from Matlab. Shoot for -30 to -50 dB attenuation in the stopband and 3 dB ripple in the passband.

23
ответ дан 27 November 2019 в 07:18
поделиться
Другие вопросы по тегам:

Похожие вопросы: