forked from PAWPAW-Mirror/lib_xua
audio scaling for pdm
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,76 +1,90 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<projectDescription>
|
<projectDescription>
|
||||||
<name>module_usb_audio</name>
|
<name>module_usb_audio</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
<name>com.xmos.cdt.core.LegacyProjectCheckerBuilder</name>
|
||||||
<triggers>clean,full,incremental,</triggers>
|
<arguments>
|
||||||
<arguments>
|
</arguments>
|
||||||
<dictionary>
|
</buildCommand>
|
||||||
<key>?children?</key>
|
<buildCommand>
|
||||||
<value>?name?=outputEntries\|?children?=?name?=entry\\\\|\\|\||</value>
|
<name>com.xmos.cdt.core.ProjectInfoSyncBuilder</name>
|
||||||
</dictionary>
|
<arguments>
|
||||||
<dictionary>
|
</arguments>
|
||||||
<key>?name?</key>
|
</buildCommand>
|
||||||
<value></value>
|
<buildCommand>
|
||||||
</dictionary>
|
<name>com.xmos.cdt.core.ModulePathBuilder</name>
|
||||||
<dictionary>
|
<arguments>
|
||||||
<key>org.eclipse.cdt.make.core.append_environment</key>
|
</arguments>
|
||||||
<value>true</value>
|
</buildCommand>
|
||||||
</dictionary>
|
<buildCommand>
|
||||||
<dictionary>
|
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||||
<key>org.eclipse.cdt.make.core.buildArguments</key>
|
<triggers>clean,full,incremental,</triggers>
|
||||||
<value>CONFIG=Debug</value>
|
<arguments>
|
||||||
</dictionary>
|
<dictionary>
|
||||||
<dictionary>
|
<key>?children?</key>
|
||||||
<key>org.eclipse.cdt.make.core.buildCommand</key>
|
<value>?name?=outputEntries\|?children?=?name?=entry\\\\|\\|\||</value>
|
||||||
<value>xmake</value>
|
</dictionary>
|
||||||
</dictionary>
|
<dictionary>
|
||||||
<dictionary>
|
<key>?name?</key>
|
||||||
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
|
<value></value>
|
||||||
<value>clean</value>
|
</dictionary>
|
||||||
</dictionary>
|
<dictionary>
|
||||||
<dictionary>
|
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||||
<key>org.eclipse.cdt.make.core.contents</key>
|
<value>true</value>
|
||||||
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
|
</dictionary>
|
||||||
</dictionary>
|
<dictionary>
|
||||||
<dictionary>
|
<key>org.eclipse.cdt.make.core.buildArguments</key>
|
||||||
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
<value>CONFIG=Debug</value>
|
||||||
<value>false</value>
|
</dictionary>
|
||||||
</dictionary>
|
<dictionary>
|
||||||
<dictionary>
|
<key>org.eclipse.cdt.make.core.buildCommand</key>
|
||||||
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
<value>xmake</value>
|
||||||
<value>true</value>
|
</dictionary>
|
||||||
</dictionary>
|
<dictionary>
|
||||||
<dictionary>
|
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
|
||||||
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
<value>clean</value>
|
||||||
<value>true</value>
|
</dictionary>
|
||||||
</dictionary>
|
<dictionary>
|
||||||
<dictionary>
|
<key>org.eclipse.cdt.make.core.contents</key>
|
||||||
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
|
||||||
<value>true</value>
|
</dictionary>
|
||||||
</dictionary>
|
<dictionary>
|
||||||
<dictionary>
|
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||||
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
<value>false</value>
|
||||||
<value>false</value>
|
</dictionary>
|
||||||
</dictionary>
|
<dictionary>
|
||||||
</arguments>
|
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||||
</buildCommand>
|
<value>true</value>
|
||||||
<buildCommand>
|
</dictionary>
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
<dictionary>
|
||||||
<triggers>full,incremental,</triggers>
|
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||||
<arguments>
|
<value>true</value>
|
||||||
</arguments>
|
</dictionary>
|
||||||
</buildCommand>
|
<dictionary>
|
||||||
</buildSpec>
|
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||||
<natures>
|
<value>true</value>
|
||||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
</dictionary>
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
<dictionary>
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||||
<nature>com.xmos.cdt.core.XdeProjectNature</nature>
|
<value>false</value>
|
||||||
</natures>
|
</dictionary>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||||
|
<triggers>full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||||
|
<nature>com.xmos.cdt.core.XdeProjectNature</nature>
|
||||||
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,13 @@ typedef struct {
|
|||||||
} synchronised_audio;
|
} synchronised_audio;
|
||||||
|
|
||||||
|
|
||||||
|
static int dc_offset_removal(int sample, int &prex_x, int &prev_y){
|
||||||
|
int r = prev_y- (prev_y>>5) + (sample - prex_x);
|
||||||
|
prex_x = sample;
|
||||||
|
prev_y = r;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
void example(streaming chanend c_ds_output_0, streaming chanend c_ds_output_1, streaming chanend c_pcm_out)
|
void example(streaming chanend c_ds_output_0, streaming chanend c_ds_output_1, streaming chanend c_pcm_out)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -35,6 +42,8 @@ void example(streaming chanend c_ds_output_0, streaming chanend c_ds_output_1, s
|
|||||||
synchronised_audio audio[2]; //double buffered
|
synchronised_audio audio[2]; //double buffered
|
||||||
memset(audio, sizeof(synchronised_audio), 2);
|
memset(audio, sizeof(synchronised_audio), 2);
|
||||||
|
|
||||||
|
int prev_x[7] = {0};
|
||||||
|
int prev_y[7] = {0};
|
||||||
|
|
||||||
unsafe
|
unsafe
|
||||||
{
|
{
|
||||||
@@ -52,15 +61,17 @@ void example(streaming chanend c_ds_output_0, streaming chanend c_ds_output_1, s
|
|||||||
|
|
||||||
buffer = 1 - buffer;
|
buffer = 1 - buffer;
|
||||||
|
|
||||||
//The data has already been bit reversed in the downsampler
|
|
||||||
|
|
||||||
// audio[buffer] is good to go
|
// audio[buffer] is good to go
|
||||||
//xscope_int(0, audio[buffer].data[0][0].ch_a);
|
|
||||||
//xscope_int(1, audio[buffer].data[0][0].ch_b);
|
int a = dc_offset_removal( audio[buffer].data[1][0].ch_a, prev_x[0], prev_y[0]);
|
||||||
|
int b = dc_offset_removal( audio[buffer].data[1][0].ch_b, prev_x[1], prev_y[1]);
|
||||||
|
|
||||||
|
xscope_int(0,a);
|
||||||
|
xscope_int(1,b);
|
||||||
|
|
||||||
c_pcm_out :> unsigned req;
|
c_pcm_out :> unsigned req;
|
||||||
c_pcm_out <: audio[buffer].data[0][0].ch_a;
|
c_pcm_out <: (a>>14);
|
||||||
c_pcm_out <: audio[buffer].data[0][0].ch_b;
|
c_pcm_out <: (b>>14);
|
||||||
//printintln(audio[buffer].data[0][0].ch_b);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user