現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
whats wrong in the following?
3 ビュー (過去 30 日間)
古いコメントを表示
[y, Fs] = audioread('Track48.wav');
y1 = y(:,1); y2 = y(:,2);
Y = [y1 y2];
wavwrite(Y ,Fs, 'newfile.wav');
% %audiowrite('newfile.wav', Y ,Fs);
........................................................................................
Error on running:
Error using wavwrite>OpenWaveWrite (line 170)
Unable to open file. Reason: Permission denied
Error in wavwrite (line 96)
fid = OpenWaveWrite(wavefile);
Error in Test2 (line 16)
wavwrite(Y ,Fs, 'newfile.wav');
Thanks a lot
回答 (1 件)
madhan ravi
2019 年 1 月 10 日
編集済み: madhan ravi
2019 年 1 月 10 日
Try changing the working directory or run as administrator it is clear from the message that file permission is denied.
21 件のコメント
VINAYAK KARANDIKAR
2019 年 1 月 10 日
The working directory is the same as the one in which the MATLAB file is located. Everything is alright there. The problem is with the code, i think!!!
VINAYAK KARANDIKAR
2019 年 1 月 10 日
No, i restarted the computer and now i get better results while testing the larger code, of which i had sent only a snippet. Nevertheless, i think there is a problem with the audio files itself. If i send them here, can someone tell me if they know how to hear them? Maybee someone can give me their email address, the files are too large to even compress them?
Thanks
Walter Roberson
2019 年 1 月 10 日
no that error can only ever mean that you are not authorised to create the file at that location or that you are not authorised to overwrite an existing file at that location . It can never mean there is a problem in the content of the file .
If the code works for a bit but then fails then one possibility is that you or the code changed to a different directory .
VINAYAK KARANDIKAR
2019 年 1 月 10 日
But man, that error no longer appears. Only i cannot hear anything when i play the audio now.
Walter Roberson
2019 年 1 月 10 日
which release are you using and which operating system ? You should probably be switching to audiowrite()
VINAYAK KARANDIKAR
2019 年 1 月 10 日
@Walter Roberson: I use 2013b MATLAB on Windows 10. I have used audio write function as well. Its commented in my code above, as you can see. I was expermenting with various permutations and combinations. Thanks
Walter Roberson
2019 年 1 月 10 日
Try
[y, Fs] = audioread('Track48.wav');
audiowrite('newfile.wav', y, Fs);
and see if there is any difference in what you hear between the two using an external player.
VINAYAK KARANDIKAR
2019 年 1 月 10 日
Hey, this works fine with 'track48.wav' but not with 'SDRSharp_20171103_160212Z_97990kHz_IQ.wav'
I think there is something wrong with the latter audio wav file only.
VINAYAK KARANDIKAR
2019 年 1 月 10 日
Hey here is the link: https://drive.google.com/open?id=1z71VFMaRHrsIuQVBLmiqq_aLBhewrJZS
Let me know what you have been able to find out and do?
Walter Roberson
2019 年 1 月 12 日
That file has a sample frequency of 900001 which is beyond the capabilities of my hardware to play.
VINAYAK KARANDIKAR
2019 年 1 月 12 日
Exactly. Something is wrong with this file. I will get back to my file provider about this. Thanks a lot. I think we can close this discussion here?
Walter Roberson
2019 年 1 月 13 日
Based on the file name, it looks like it might be from a scientific instrument that was sampling at 97990kHz (nearly 1 GHz), and that it is possibly in quadrature mode. I am not currently convinced that it is intended to be "sound" in the human range.
... Though if it is quadrature encoded, it does not appear to have constellations.
If you use the 'native' mode for audioread(), and look at min() and max() of the data, it looks like it does not span the full range like human sound would be likely to. It looks like it is close to symmetric around 0 with a full span that just might be 2^14*3/2 or possibly 24000 .
Ah, look at that. Filename is SDRSharp_20170415_070322Z_97990kHz_IQ.wav and SDRSharp is the name of a Software Defined Radio program. You are not dealing with audio.
VINAYAK KARANDIKAR
2019 年 1 月 13 日
If i am not dealing with audio, then what is the nature of the signal according to you?
And how do i use MATLAB to process it?
Basically i am supposed to implement a Digital FM Stereo Receiver in MATLAB to process this signal(the wav file i sent here)
Thanks
Walter Roberson
2019 年 1 月 13 日
The file is samples of radio frequency transmissions. Storing it in a .wav was convenient to the people who created it, but that does not mean that it was audio in the human sense. It is just data recordings.
The data was recorded with the program SDR# (SDRSharp)
audioinfo() reports that it is 16 bits per sample, and examining the data I see differences in value at the int16 level as small as 1, but the top bit does not seem to be used. This suggests that it really is 16 bits, rather than 12 bits stuffed into 16. However, if you look at histogram in more detail, it looks likely that the samples are in bins of width 2^8 (256) at the int16 level, as if there were roughly 91 frequency bins that are 256 apart and that for whatever reason, values are distributed around those centers instead of being exactly those centers (perhaps for phase reasons, perhaps for signal edge transition reasons, perhaps for noise reasons.) But if you
[data,fs] = audioread('SDRSharp_20170415_070322Z_97990kHz_IQ.wav', 'native');
N = 8; histogram(floor(data(:)/(2^N)),-2^(14-N):2^(14-N)-1)
then you do get a nice smooth bimodal distribution with the peaks near +/- 3072 (and distinctly non-trivial counts between.) This is not a binary encoding.
You mentioned FM: frequency modulation around centers 256 apart could plausibly account for the bin shapes.
The file name hints at 97.9 MHz, which is plausible for FM Channel 250 https://en.wikipedia.org/wiki/List_of_channel_numbers_assigned_to_FM_frequencies_in_North_America for non-digital FM radio, but the file name also hints at 97.99 MHz which could be "98.0 MHz" which could be from Europe or Africa (in North America, only odd frequencies are used.)
I am getting a bit lost following the technical description of how FM encodes stereo.
Atch, I just realized that in part I have been mentally confusing frequency vs amplitude. The histograms I am referring to above are about amplitude. You need to do a frequency analysis.
Walter Roberson
2019 年 1 月 13 日
Introduced in R2014b
You can use hist() instead of histogram() for this purpose.
Next time please fill out the Product / Release fields in your question so that we do not give you answers that are not suitable for your old release.
VINAYAK KARANDIKAR
2019 年 1 月 13 日
Alright, thanks.
So basically my question is answered: Its not an audio file, i won't hear a human sound.
Next i have to design a FM receiver.
Does the material in the above link, particularly the decoder diagram suffice for this task(FM Receiver design in MATLAB), in your opinion?
Thanks
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)