<commit_before>#include "Filter.h"
#include <vector>

using namespace std;

Filter::Filter(float length = 0.65) {
	int i;

	// Saiten-Koeffizienten
	this->l = length;
	this->Ts = 60.97;
	this->rho = 1140;
	this->A = 0.5188e-6;
	this->E = 5.4e9;
	this->I = 0.171e-12;
	this->d1 = 8e-5;
	this->d3 = -1.4e-5;

	// Abtastpunkt
	this->xa = 0.1;

	// Abtastrate und Samplelänge
	this->T = 44100;
	this->seconds = 1;
	this->samples = seconds*T;
	this->filters = 30;

	// Blockverarbeitungs-Länge
	this->blocksize = 100;

	// Ausgangssignal
	y = (float*) malloc(samples * sizeof(float));


	this->createMatrices();

//	cout << MC.toString() << endl << endl;
	cout << MA.toString() << endl << endl;
//	cout << Mstate.toString() << endl << endl;

	for(i = 0; i < this->samples; i++) {
		y[i] = this->MC.multiply(this->Mstate).get(0,0);
		this->Mstate = this->MA.multiply(this->Mstate);
	}

//	std::cout << y;
}

void Filter::createMatrices() {
	int i;
	double gamma, sigma, omega;
	double a, b, c1, c0;

	this->MC.resize(1, 2 * this->filters);
	this->MA.resize(2 * this->filters, 2 * this->filters);
	this->Mstate.resize(2 * this->filters, 1);

	for(i = 1; i < this->filters+1; i++) {
		gamma = i * ( M_PI / this->l );
		sigma = (1 / (2 * this->rho * this->A) ) * (this->d3 * pow(gamma,2) - this->d1);
		omega = sqrt(
				  (
					( (this->E * this->I) / (this->rho * this->A) )
					- ( pow(this->d3, 2) / pow(2 * this->rho * this->A, 2) ) * pow(gamma, 4) 
				  )
				+ ( (this->Ts / (this->rho * this->A) ) * pow(gamma, 2) )<commit_msg>Omega als Integer<commit_after>#include "Filter.h"
#include <vector>

using namespace std;

Filter::Filter(float length = 0.65) {
	int i;

	// Saiten-Koeffizienten
	this->l = length;
	this->Ts = 60.97;
	this->rho = 1140;
	this->A = 0.5188e-6;
	this->E = 5.4e9;
	this->I = 0.171e-12;
	this->d1 = 8e-5;
	this->d3 = -1.4e-5;

	// Abtastpunkt
	this->xa = 0.1;

	// Abtastrate und Samplelänge
	this->T = 44100;
	this->seconds = 1;
	this->samples = seconds*T;
	this->filters = 30;

	// Blockverarbeitungs-Länge
	this->blocksize = 100;

	// Ausgangssignal
	y = (float*) malloc(samples * sizeof(float));


	this->createMatrices();

//	cout << MC.toString() << endl << endl;
	cout << MA.toString() << endl << endl;
//	cout << Mstate.toString() << endl << endl;

	for(i = 0; i < this->samples; i++) {
		y[i] = this->MC.multiply(this->Mstate).get(0,0);
		this->Mstate = this->MA.multiply(this->Mstate);
	}

//	std::cout << y;
}

void Filter::createMatrices() {
	int i;
	double gamma, sigma;
	int omega;
	double a, b, c1, c0;

	this->MC.resize(1, 2 * this->filters);
	this->MA.resize(2 * this->filters, 2 * this->filters);
	this->Mstate.resize(2 * this->filters, 1);

	for(i = 1; i < this->filters+1; i++) {
		gamma = i * ( M_PI / this->l );
		sigma = (1 / (2 * this->rho * this->A) ) * (this->d3 * pow(gamma,2) - this->d1);
		omega = sqrt(
				  (
					( (this->E * this->I) / (this->rho * this->A) )
					- ( pow(this->d3, 2) / pow(2 * this->rho * this->A, 2) ) * pow(gamma, 4) 
				  )
				+ ( (this->Ts / (this->rho * this->A) ) * pow(gamma, 2) )
{'fraction_non_alphanumeric': 0.22627975220084773, 'fraction_numerical': 0.04564721225953701, 'mean_word_length': 2.8688524590163933, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 93, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '721173', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1303, 'n_words': 271}